GNOME Bugzilla – Bug 747351
ckit: (x11-)display-device not properly set?
Last modified: 2015-04-11 11:13:27 UTC
Hi. As per #743940 I am using --with-console-kit (yeah I know) to build GDM but there's something not quite right at runtime. I can login just fine but my session is never set as active. 3.16 ---- Session2: unix-user = '1000' realname = 'Antoine Jacoutot' seat = 'Seat3' session-type = '' active = FALSE x11-display = ':0' x11-display-device = '' display-device = 'ttyC0' remote-host-name = '' is-local = TRUE on-since = '2015-04-04T21:36:37.098522Z' login-session-id = '' 3.14 ---- Session2: unix-user = '1000' realname = 'Antoine Jacoutot' seat = 'Seat1' session-type = '' active = TRUE x11-display = ':0' x11-display-device = '/dev/ttyC4' display-device = '/dev/ttyC4' remote-host-name = '' is-local = TRUE on-since = '2015-02-18T05:49:56.320451Z' login-session-id = '' As you can see, the display-device and x11-display-device are different in 3.14 and 3.16 -- not sure this is where the main issue is coming from but well... I am currently going all the commits but that will take some time, so if anyone has an idea ;-) Thanks!
I forgot to mention an important information. If I run this as part of .xinitrc (and use startx): exec ck-launch-session gnome-session then everything works as expected: Session4: unix-user = '1000' realname = 'Antoine Jacoutot' seat = 'Seat1' session-type = '' active = TRUE x11-display = ':0' x11-display-device = '/dev/ttyC4' display-device = 'ttyC0' remote-host-name = '' is-local = TRUE on-since = '2015-04-04T22:50:37.354752Z' login-session-id = ''
Can you turn on debugging and post the log? I do see one issue in the code just browsing around. will attach a patch. mind trying it?
Created attachment 301078 [details] [review] legacy-display: ensure X11 display device is propagated to launch environment Once the server associated with the login screen session is ready, we query its display device for ConsoleKit. This device needs to get propagated to the session to ensure ConsoleKit can track session activeness properly. This commit makes sure the display device is plumbed from the GdmServer object to the GdmLaunchEnvironment object where it gets used by the the login session (and subsequently the user session).
Hi Ray. Running with the patch now but it does not seem to help. I'm attaching gdm debug output.
Created attachment 301081 [details] gdm greeter log
oh i need the gdm logs not greeter session logs
(In reply to Ray Strode [halfline] from comment #6) > oh i need the gdm logs not greeter session logs Ah. Hmm, where I can find these?
Created attachment 301084 [details] [review] legacy-display: ensure X11 display device is propagated to launch environment Once the server associated with the login screen session is ready, we query its display device for ConsoleKit. This device needs to get propagated to the session to ensure ConsoleKit can track session activeness properly. This commit makes sure the display device is plumbed from the GdmServer object to the GdmLaunchEnvironment object where it gets used by the the login session (and subsequently the user session).
give this one ^^ a try, i think it should fix things. daemon logs should be next to the greeter logs in /var/log/gdm if you don't have systemd journal.
(In reply to Ray Strode [halfline] from comment #9) > give this one ^^ a try, i think it should fix things. Hey Ray. Thanks a lot for looking into this... I know how much relevance ConsoleKit must be to you :-/ The latest patch still does not help things for me though. > daemon logs should be next to the greeter logs in /var/log/gdm if you don't > have systemd journal. I only have :{0,1,2,3,4}-greeter.log and :{0,1,2,3,4}.log (gdm's X.org log) in there...
After Antoine mentioned he had problems with consolekit, I check what the output was on FreeBSD. Session2: unix-user = '1001' realname = 'Koop Mast' seat = 'Seat1' session-type = '' active = FALSE x11-display = ':0' x11-display-device = 'ERROR: Failed to find X lock file for display 0' display-device = ' ? ' remote-host-name = '' is-local = TRUE on-since = '2015-04-08T08:57:38.782242Z' login-session-id = '' After applying the patch from #8 it works again. Session6: unix-user = '1001' realname = 'Koop Mast' seat = 'Seat1' session-type = '' active = TRUE x11-display = ':0' x11-display-device = '/dev/ttyv8' display-device = 'pts/1' remote-host-name = '' is-local = TRUE on-since = '2015-04-08T09:04:34.063070Z' login-session-id = '' For some reason I don't have a gdm.log either, only :0.log from xorg-server and 0-greeter.log. After enabling debug in gdm's custom.conf it printed debug information to the terminal.
> After applying the patch from #8 it works again. Interesting that it works for you. Now maybe that's because we need to revert this on OpenBSD: https://git.gnome.org/browse/gdm/commit/?id=956d7d1c7a0cfbf2beacdb9e88e645e15ad32047 for the lack of sigwaitinfo() here.
Ok I found out why it works on FreeBSD and not on OpenBSD. This is what I can see in GDM logs: gdm[25958]: GdmManager: Running helper /usr/local/libexec/ck-get-x11-display-device --display :0 ** (ck-get-x11-display-device:23761): WARNING **: cannot open display: :0 gdm[25958]: GdmManager: Got tty: '' The difference is that FreeBSD replaced the original ck-get-x11-display-device with a home-made script that uses fstab to return the display.
Created attachment 301141 [details] gdm session log For the sake of completeness, here's the GDM session log.
Ok so after a bit more debugging, it seems that ck-get-x11-display-device is called while the X server is not up yet. At lest I can see that when running a script similar to what FreeBSD is using as a replacement for ck-get-x11-display-device. The script tries to cat /tmp/.X0-lock but it's not there yet, hence the failure.
ah i see one bug that might explain why it's not working for you. we're getting the display number in #ifdef WITH_PLYMOUTH guards.
Created attachment 301317 [details] [review] manager: properly query display number when built without plymouth The code to query the display number of the display object is erroneously tucked away in guards. This leads to the display device getting queried prematurely.
Attachment 301084 [details] pushed as db9ee47 - legacy-display: ensure X11 display device is propagated to launch environment ( pushing this one, since it fixes the problem for some ConsoleKit users, but leaving bug open until the next patch can be confirmed )
(In reply to Ray Strode [halfline] from comment #17) > Created attachment 301317 [details] [review] [review] > manager: properly query display number when built without plymouth > > The code to query the display number of the display object is > erroneously tucked away in > > guards. This leads to the display device getting queried prematurely. Duh... stupid me for not figuring this out. Awesomeness achieved, it works perfectly now :-) Thanks a lot Ray.
Attachment 301317 [details] pushed as 172534d - manager: properly query display number when built without plymouth