[systemd-devel] Fwd: sd 221 regression: login - nonexistent sessions via lightdm

Martin Pitt martin.pitt at ubuntu.com
Tue Jul 7 21:47:20 PDT 2015


Hey Robert, all,

Robert Ancell [2015-07-07 23:53 +0000]:
> 1. LightDM starts up
> 2. LightDM starts an X server on a free VT (e.g. 7)
> 3. LightDM starts a greeter process which connects to the X server. Via
> libpam-systemd a logind session is opened.
> 4. User logs in via greeter.
> 5. LightDM stops the greeter by sending a SIGTERM to it.  The greeter
> closes the PAM session which closes the logind session.
> 6. LightDM starts the user session. The existing X server is used so this
> session is on the same VT as the greeter session was.
> 
> The issue is that after step 5 LightDM considers the greeter session to be
> completely closed. However, it appears that closing the PAM session only
> cases the logind session to be put into the "closing" state.

Indeed. But it's the actual session's job (gnome-session?) to ensure
that all child processes actually get killed. I usually get some stray
pulseaudio processes, other people reported more processes.

We don't currently enable KillUserProcesses where logind would
actually kill the remaining processes in the greeter cgroup, as we
don't want to do this by default for real user sessions (that would
break screen or other background services). Perhaps it would make
sense to enable this for class == SESSION_GREETER?

> As pointed out we have an issue where Unity Greeter isn't waiting
> for some of its child processes before exiting and that is keeping
> the logind session open for a short time. I think there's still a
> race here in any case because the display manager just has no idea
> when the session is really closed.

Synchronously waiting for the leftover processes sounds like a bad
idea. They take some half a minute here, and for Christopher in LP
#1472259 they don't seem to terminate by themselves at all. So you'd
actually need to actively kill them. lightdm could be more foreful by
using KillSession() instead of TerminateSession(), or maybe logind
itself should imply killing with class == SESSION_GREETER (as I
mentioned above)?

> So the correct solution might be to just to ignore logind sessions in the
> "closing" state when checking if a VT is used more than once.

That indeed also sounds good; David, WDYT? It seems the current patch
caused a regression in gdm, so maybe that is a better workaround for
222 until this gets fixed properly?

Thanks,

Martin
-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)


More information about the systemd-devel mailing list