Bug 210829 - prefdm hang when running kdm with nodaemon
Summary: prefdm hang when running kdm with nodaemon
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: initscripts
Version: 4
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Brock Organ
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-10-15 23:12 UTC by Yan Morin
Modified: 2014-03-17 03:03 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2007-09-18 19:34:20 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Yan Morin 2006-10-15 23:12:43 UTC
Description of problem:
Infinite /etc/X11/prefdm loop running

How reproducible:
Always...

Steps to Reproduce:
1. Boot with initlevel 3
2. log in as root
3. add DISPLAYMANAGER=KDE to /etc/sysconfig/desktop
(echo "DISPLAYMANAGER=KDE" >> /etc/sysconfig/desktop)
4. run /etc/X11/prefdm
  
Actual results:
infinite loop

Expected results:
no infinite loop

Additional info:
Code in /etc/X11/prefdm
if [ -n "$preferred" ]; then
        $preferred "$@" >/dev/null 2>&1
        if [ $? -ne 127 ]; then
               exec $0 "$@"
               exit $?
        fi
        exit $?
fi

If you look, it execute kdm with prefdm argument ($@).
Then it takes the return, and exec again prefdm if the result is not 127.

The problem is that when you don't send -nodaemon to kdm inside a bash shell
(the bash shell don't have a pid of 1), kdm return immediatly the number 0 in
daemon mode.
See kdm source code, function main():
http://websvn.kde.org/trunk/KDE/kdebase/workspace/kdm/backend/dm.c?rev=585460&view=auto#10

kdm could also return the number 1 if their is a xdm already running.

Comment 1 Bill Nottingham 2006-10-16 15:48:55 UTC
Does this still happen in FC5 or the FC6 development tree?

Comment 2 Yan Morin 2006-10-23 14:30:30 UTC
Still happen in FC5. (it's the same prefdm script for this part)

Comment 3 Bill Nottingham 2006-10-23 18:25:05 UTC
I don't see this in testing - I set the display manager to kdm, and it runs fine.

Is there anything else unusual in your setup?

Comment 4 Yan Morin 2006-11-10 21:05:24 UTC
Same problem on a fresh and clean install of FC6.

If you want to see the loop, try some 
ps ax
ps ax
ps ax
ps ax
And see the kdm/gdm process number that are changing...

or display an echo "in prefdm" at the beginning of the script


Comment 5 Bill Nottingham 2006-11-10 21:27:20 UTC
Oh, after re-reading I understand.

Why are you running prefdm without -nodaemon by hand?


Comment 6 Yan Morin 2006-11-11 14:53:18 UTC
I want to try the script, like when it starting normally. (Check what is the
default desktop manager used, what will be the result.)

Is there a documentation where the -nodaemon is specified and obligatory? 
in prefdm --help ?   man prefdm?


Comment 7 Bill Nottingham 2006-11-14 03:36:19 UTC
It's not documented as such, but it's more or less expected that that's how it
will be invoked.

Comment 8 Christian Iseli 2007-01-22 10:44:20 UTC
This report targets the FC3 or FC4 products, which have now been EOL'd.

Could you please check that it still applies to a current Fedora release, and
either update the target product or close it ?

Thanks.

Comment 9 Bill Nottingham 2007-09-18 19:34:20 UTC
Closing; this is expected behavior.


Note You need to log in before you can comment on or make changes to this bug.