[Bug 1089287] New: sddm default configuration misses -keeptty option for X server
http://bugzilla.suse.com/show_bug.cgi?id=1089287 Bug ID: 1089287 Summary: sddm default configuration misses -keeptty option for X server Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: All OS: openSUSE Factory Status: NEW Severity: Normal Priority: P5 - None Component: KDE Applications Assignee: opensuse-kde-bugs@opensuse.org Reporter: werner@suse.com QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- The current configuration in /usr/lib/sddm/sddm.conf.d/00-general.conf misses the option -keeptty to help the systemd-logind to identify the X server on vt7 with its controlling tty -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1089287
Dr. Werner Fink
http://bugzilla.suse.com/show_bug.cgi?id=1089287
http://bugzilla.suse.com/show_bug.cgi?id=1089287#c1
--- Comment #1 from Dr. Werner Fink
http://bugzilla.suse.com/show_bug.cgi?id=1089287
http://bugzilla.suse.com/show_bug.cgi?id=1089287#c2
Fabian Vogt
The current configuration in /usr/lib/sddm/sddm.conf.d/00-general.conf misses the option -keeptty to help the systemd-logind to identify the X server on vt7 with its controlling tty
Can this have any unexpected side effects or is it safe to enable it in all cases? I don't think sddm sets the controlling terminal on VT switches, so this might actually break it... -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1089287
http://bugzilla.suse.com/show_bug.cgi?id=1089287#c3
--- Comment #3 from Dr. Werner Fink
(In reply to Dr. Werner Fink from comment #0)
The current configuration in /usr/lib/sddm/sddm.conf.d/00-general.conf misses the option -keeptty to help the systemd-logind to identify the X server on vt7 with its controlling tty
Can this have any unexpected side effects or is it safe to enable it in all cases?
I don't think sddm sets the controlling terminal on VT switches, so this might actually break it...
This is save (IMHO) ... only startx could run into problems, but startx uses /etc/X11/xdm/Xservers (where -keeptty is already set) The EE message about [ 840.157] (EE) systemd-logind: failed to get session: PID 2837 does not belong to any known session remains, but this seems to be another problem. There seems to exist a process which already locks the controlling tty on vt7 -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1089287
Dr. Werner Fink
http://bugzilla.suse.com/show_bug.cgi?id=1089287
http://bugzilla.suse.com/show_bug.cgi?id=1089287#c4
Fabian Vogt
http://bugzilla.suse.com/show_bug.cgi?id=1089287
http://bugzilla.suse.com/show_bug.cgi?id=1089287#c5
--- Comment #5 from Swamp Workflow Management
http://bugzilla.suse.com/show_bug.cgi?id=1089287
http://bugzilla.suse.com/show_bug.cgi?id=1089287#c6
Fabian Vogt
http://bugzilla.suse.com/show_bug.cgi?id=1089287
http://bugzilla.suse.com/show_bug.cgi?id=1089287#c7
Dr. Werner Fink
This had the opposite effect: https://openqa.opensuse.org/tests/656629#step/xorg_vt/4
Now ps does not show tty7 for X anymore, while it worked fine previously.
Any idea? I'll revert it for now.
Hmmm ... manual page of Xorg says: -keeptty Prevent the server from detaching its initial controlling terminal. If you want to use systemd-logind integration you must specify this option. Not all platforms support (or can use) this option. ... interesting fact is tath I see here [ 18039.023] (EE) systemd-logind: failed to get session: PID 31661 does not belong to any known session ... in other words this option does not work as it should ... maybe something has been disabled in the X server which does not do the controlling terminal stuff. Btw: Without the option an other error messages appears which shouts that -keeptty option is required -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1089287
http://bugzilla.suse.com/show_bug.cgi?id=1089287#c8
--- Comment #8 from Stefan Dirsch
http://bugzilla.suse.com/show_bug.cgi?id=1089287
http://bugzilla.suse.com/show_bug.cgi?id=1089287#c9
Stefan Dirsch
[ 18039.023] (EE) systemd-logind: failed to get session: PID 31661 does not belong to any known session
... in other words this option does not work as it should ... maybe something has been disabled in the X server which does not do the controlling terminal stuff.
No idea. Andreas Jaeger ran into the same issue after updating his system from 42.3 to 15.0 (forgot about bugzilla number). He didn't run into the issue when installing 42.3 from scratch and then updating his sytem to 15.0. So not so easy to reproduce ... Could be some dbus related issue ... Needs to be debugged on the system. hw/xfree86/os-support/linux/systemd-logind.c static void connect_hook(DBusConnection *connection, void *data) [...] msg = dbus_message_new_method_call("org.freedesktop.login1", "/org/freedesktop/login1", "org.freedesktop.login1.Manager", "GetSessionByPID"); [...] reply = dbus_connection_send_with_reply_and_block(connection, msg, DBUS_TIMEOUT_USE_DEFAULT, &error); if (!reply) { LogMessage(X_ERROR, "systemd-logind: failed to get session: %s\n", error.message); [...] Maybe somebody here known how to use dbus-send, so things could be investigated on the system even without debugging this ...
Btw: Without the option an other error messages appears which shouts that -keeptty option is required
This message has been added with git commit of comment#8. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1089287
Stefan Dirsch
http://bugzilla.suse.com/show_bug.cgi?id=1089287
http://bugzilla.suse.com/show_bug.cgi?id=1089287#c10
--- Comment #10 from Franck Bui
The EE message about
[ 840.157] (EE) systemd-logind: failed to get session: PID 2837 does not belong to any known session
remains, but this seems to be another problem. There seems to exist a process which already locks the controlling tty on vt7
Hmm it would be interesting to find out the session X server belongs to. You can try "ps -eo cmd,lsession | grep X" or something similar. If X server doesn't have a session, it might be SDDM that hasn't properly set up things before starting the server. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1089287
http://bugzilla.suse.com/show_bug.cgi?id=1089287#c11
--- Comment #11 from Fabian Vogt
(In reply to Dr. Werner Fink from comment #3)
The EE message about
[ 840.157] (EE) systemd-logind: failed to get session: PID 2837 does not belong to any known session
remains, but this seems to be another problem. There seems to exist a process which already locks the controlling tty on vt7
Hmm it would be interesting to find out the session X server belongs to.
You can try "ps -eo cmd,lsession | grep X" or something similar.
If X server doesn't have a session, it might be SDDM that hasn't properly set up things before starting the server.
I just checked the source code, it only calls setsid() for the user session, so after login. I guess sddm needs to call setsid() before starting X? -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1089287
http://bugzilla.suse.com/show_bug.cgi?id=1089287#c14
--- Comment #14 from Stefan Dirsch
http://bugzilla.suse.com/show_bug.cgi?id=1089287
http://bugzilla.suse.com/show_bug.cgi?id=1089287#c15
--- Comment #15 from Swamp Workflow Management
http://bugzilla.suse.com/show_bug.cgi?id=1089287
http://bugzilla.suse.com/show_bug.cgi?id=1089287#c16
Fabian Vogt
http://bugzilla.suse.com/show_bug.cgi?id=1089287
http://bugzilla.suse.com/show_bug.cgi?id=1089287#c17
--- Comment #17 from Dr. Werner Fink
I tried to debug this further, the issue is that sddm doesn't actually create a session and set a controlling tty. That's currently done by the X server. This explains why -keeptty does not work and also why loginctl doesn't show vt7.
sddm only calls setsid for the user session, but as there's no X server in the user session it doesn't get a controlling terminal either.
While looking at lightdm to check how it's done properly I noticed that it has the exact same issue.
What does sddm need to do to work with -keeptty?
How does gdm solve this problem? AFAICR the -keeptty option should avoid deteaching the controlling terminal by the X server. But here it is not connectted to the tty7 anymore: ps aux | grep bin/ root 2176 0.5 0.8 499472 70108 ? Sl Jul02 60:21 /usr/bin/X -nolisten tcp -keeptty -auth /run/sddm/{ac43390f-4fcf-4711-b111-99f6c749eb82} -background none -noreset -displayfd 17 -seat seat0 vt7 somehow strange. It seems that the option -keeptty does not work here. The question rises if this is how sddm/lightdm are starting the X server and how this differs from the method used by gdm. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1089287
http://bugzilla.suse.com/show_bug.cgi?id=1089287#c18
--- Comment #18 from Fabian Vogt
(In reply to Fabian Vogt from comment #16)
I tried to debug this further, the issue is that sddm doesn't actually create a session and set a controlling tty. That's currently done by the X server. This explains why -keeptty does not work and also why loginctl doesn't show vt7.
sddm only calls setsid for the user session, but as there's no X server in the user session it doesn't get a controlling terminal either.
While looking at lightdm to check how it's done properly I noticed that it has the exact same issue.
What does sddm need to do to work with -keeptty?
How does gdm solve this problem? AFAICR the -keeptty option should avoid deteaching the controlling terminal by the X server. But here it is not connectted to the tty7 anymore:
ps aux | grep bin/ root 2176 0.5 0.8 499472 70108 ? Sl Jul02 60:21 /usr/bin/X -nolisten tcp -keeptty -auth /run/sddm/{ac43390f-4fcf-4711-b111-99f6c749eb82} -background none -noreset -displayfd 17 -seat seat0 vt7
somehow strange. It seems that the option -keeptty does not work here. The question rises if this is how sddm/lightdm are starting the X server and how this differs from the method used by gdm.
gdm starts the X server rootless by default while lightdm and sddm don't. So gdm has: gdm -> greeter-helper -> greeter \ \ \ > X \ > user-helper -> user-session \ > X I assume here greeter-helper and user-helper are session leaders and have a controlling tty each. While sddm and lightdm don't start it rootless: sddm/lightdm -> greeter |\ \ > X > user-session sddm/lightdm can manage more than one tty, so they can't have a single controlling tty, by design. The user-session and X are siblings, so they can't be session leaders of their own session. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1089287
http://bugzilla.suse.com/show_bug.cgi?id=1089287#c19
Stefan Dirsch
http://bugzilla.suse.com/show_bug.cgi?id=1089287
http://bugzilla.suse.com/show_bug.cgi?id=1089287#c20
--- Comment #20 from Fabian Vogt
http://bugzilla.suse.com/show_bug.cgi?id=1089287
http://bugzilla.suse.com/show_bug.cgi?id=1089287#c21
Stefan Dirsch
http://bugzilla.suse.com/show_bug.cgi?id=1089287
http://bugzilla.suse.com/show_bug.cgi?id=1089287#c22
Michal Srb
[ 840.157] (EE) systemd-logind: failed to get session: PID 2837 does not belong to any known session
It tries to find session that belongs to its own PID and that fails. If -keeptty is not set, X server doesn't even try to use the systemd-logind integration. If it is set, it tries and fails. What is actually the motivation for adding the -keeptty parameter? -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1089287
http://bugzilla.suse.com/show_bug.cgi?id=1089287#c23
Stefan Dirsch
AFAIK the systemd-logind integration in X server is only meaningful when the X server runs with the regular user's permissions inside the user's session. This is currently only the case with GDM.
SDDM starts the X server as root. In this case you can consider the X server as a system process. It is not tied to the user session that it displays - the same X server may display the greeter and later the user session as well.
That's why X shows the error:
[ 840.157] (EE) systemd-logind: failed to get session: PID 2837 does not belong to any known session
It tries to find session that belongs to its own PID and that fails.
If -keeptty is not set, X server doesn't even try to use the systemd-logind integration. If it is set, it tries and fails.
What is actually the motivation for adding the -keeptty parameter?
Werner? -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1089287
http://bugzilla.suse.com/show_bug.cgi?id=1089287#c24
Dr. Werner Fink
(In reply to Michal Srb from comment #22)
What is actually the motivation for adding the -keeptty parameter?
Werner?
The explicit warning of the login manager of systemd about missing -keeptty -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1089287
http://bugzilla.suse.com/show_bug.cgi?id=1089287#c25
--- Comment #25 from Stefan Dirsch
What is actually the motivation for adding the -keeptty parameter?
Werner?
The explicit warning of the login manager of systemd about missing -keeptty
... which then appears to be wrong according to Michal Srb ... -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1089287
Stefan Dirsch
http://bugzilla.suse.com/show_bug.cgi?id=1089287
http://bugzilla.suse.com/show_bug.cgi?id=1089287#c26
Michal Srb
The explicit warning of the login manager of systemd about missing -keeptty
Can you please quote it and help me where I can find it? I have a Tumbleweed machine with SDDM here, but can't find such warning in any logs so far. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1089287
http://bugzilla.suse.com/show_bug.cgi?id=1089287#c27
--- Comment #27 from Dr. Werner Fink
(In reply to Dr. Werner Fink from comment #24)
The explicit warning of the login manager of systemd about missing -keeptty
Can you please quote it and help me where I can find it? I have a Tumbleweed machine with SDDM here, but can't find such warning in any logs so far.
The X server throws this: systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1089287
Dr. Werner Fink
http://bugzilla.suse.com/show_bug.cgi?id=1089287
http://bugzilla.suse.com/show_bug.cgi?id=1089287#c28
Michal Srb
participants (1)
-
bugzilla_noreply@novell.com