GNOME Bugzilla – Bug 550170
[regression] gdm-binary 2.23 no longer implements --nodaemon
Last modified: 2010-06-19 13:02:18 UTC
Please describe the problem: <=gdm-2.20 had gdm-binary daemonizing by default with a --nodaemon argument to have it not fork. gdm-2.23 changes this behaviour making it difficult to daemonize gdm. Steps to reproduce: 1. Run `gdm-binary` Actual results: Watch as it stays attached and doesn't fork Expected results: I would expect it to daemonize by default, and have a --nodaemon argument to stay attached Does this happen every time? Yes Other information: This is especially a problem on distributions that have a common init script for running the proper DM (KDM/XDM/GDM) according to the system settings.
talking as a gentoo dev, this is a pretty important regression for us since it stops our generic xdm service to start properly.
Created attachment 120573 [details] [review] Fork gdm-binary except with -nodaemon This is a basic forward port of the code in gdm-2.20 to make gdm-binary fork except when -nodaemon/--nodaemon is used. I've tested this on a Fedora 9 machine, and it works as expected.
Created attachment 121294 [details] [review] Edited patch to implement --nodaemon (In reply to comment #2) > Created an attachment (id=120573) [edit] > Fork gdm-binary except with -nodaemon > > This is a basic forward port of the code in gdm-2.20 to make gdm-binary fork > except when -nodaemon/--nodaemon is used. I've tested this on a Fedora 9 > machine, and it works as expected. > The patch doesn't write a PID file for the child successfully. 1. The parent writes a pid file 2. The child tries to write one, but fails since it already exists. 3. The parent exits, and delete's it's PID file. 4. No PID file for GDM. The patch attached fixes this by forking *before* the PID file is written.
Created attachment 122117 [details] [review] Cleaner implementation which exits if /dev/null can't be dup2'd Here's a cleaner patch which uses dup2 for reopening stdin/out/err and exits if that fails. This also takes into account the pid writing behavior mentioned.
This was removed on purpose in: commit 7ef111365edd72158cf3fe5e84a734205b6734f2 Author: William Jon McCann <jmccann@redhat.com> Date: Tue Feb 26 22:43:04 2008 +0000 Don't daemonize and remove some unused options. I don't think we want it back.