After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 550170 - [regression] gdm-binary 2.23 no longer implements --nodaemon
[regression] gdm-binary 2.23 no longer implements --nodaemon
Status: RESOLVED NOTABUG
Product: gdm
Classification: Core
Component: general
2.23.x
Other All
: Normal normal
: ---
Assigned To: GDM maintainers
GDM maintainers
Depends on:
Blocks:
 
 
Reported: 2008-09-01 10:04 UTC by Nirbheek Chauhan
Modified: 2010-06-19 13:02 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
Fork gdm-binary except with -nodaemon (4.90 KB, patch)
2008-10-14 14:11 UTC, Dan Nicholson
none Details | Review
Edited patch to implement --nodaemon (3.72 KB, patch)
2008-10-24 17:15 UTC, Nirbheek Chauhan
none Details | Review
Cleaner implementation which exits if /dev/null can't be dup2'd (4.50 KB, patch)
2008-11-06 16:26 UTC, Dan Nicholson
none Details | Review

Description Nirbheek Chauhan 2008-09-01 10:04:07 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.
Comment 1 Gilles Dartiguelongue 2008-09-01 22:28:34 UTC
talking as a gentoo dev, this is a pretty important regression for us since it stops our generic xdm service to start properly.
Comment 2 Dan Nicholson 2008-10-14 14:11:54 UTC
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.
Comment 3 Nirbheek Chauhan 2008-10-24 17:15:54 UTC
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.
Comment 4 Dan Nicholson 2008-11-06 16:26:23 UTC
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.
Comment 5 William Jon McCann 2010-06-19 13:02:18 UTC
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.