Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 435424

Summary: [gnome-overlay] gnome-base/gdm-3.5.91: daemonize patch should daemonize before calling anything else in main()
Product: Gentoo Linux Reporter: Tom Wijsman (TomWij) (RETIRED) <tomwij>
Component: [OLD] GNOMEAssignee: Gentoo Linux Gnome Desktop Team <gnome>
Status: RESOLVED FIXED    
Severity: major    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://bugzilla.gnome.org/show_bug.cgi?id=683755#c20
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 436384    
Attachments: gdm-3.5.91-fix-daemonize-regression.patch manually adjusted to fix the dbus thread exiting to soon due to daemonization.

Description Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2012-09-18 15:18:42 UTC
See https://bugzilla.gnome.org/show_bug.cgi?id=683755#c20

Reproducible: Always

Steps to Reproduce:
1. Install gdm-3.5.91-r1
2. Reboot, log in as root, run `gdm` or `/etc/init.d/xdm start` (with gdm).
Actual Results:  
DEBUG(+): Lost GDM name on bus

Expected Results:  
Gdm starting just fine.

Because daemonize happens around the bus_reconnect call , the dbus thread waiting for the NameAcquired response gets killed way to soon so it doesn't know it acquired the name. This is evidenced in the attached strace to that upstream bug.

Putting the deamonize before g_type_init solves this particular bug.
Comment 1 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2012-09-18 15:20:49 UTC
Created attachment 324210 [details]
gdm-3.5.91-fix-daemonize-regression.patch manually adjusted to fix the dbus thread exiting to soon due to daemonization.
Comment 2 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2012-09-18 15:22:57 UTC
An alternative to this is getting rid of the patch and instead patching /usr/sbin/gdm (which is a shell script)
to do exec setsid /usr/sbin/gdm-binary "$@"

Adding that setsid will result in the same behavior as the corrected C patch.
Comment 3 Alexandre Rostovtsev (RETIRED) gentoo-dev 2012-10-28 18:20:34 UTC
I believe this was fixed in >=gdm-3.6.0, which has a rewritten daemonize patch.

Please reopen if the bug still occurs with the current gdm from the gnome overlay.