[systemd-devel] Should pam-activated systemd --user daemon quit after session has been closed?

Armin K. krejzi at email.com
Fri Jan 22 15:20:34 PST 2016


On 23.01.2016 00:17, Kai Krakow wrote:
> Am Fri, 22 Jan 2016 23:19:11 +0100
> schrieb "Armin K." <krejzi at email.com>:
> 
>> I use KDE Plasma 5 and lightdm as a display manager to login to the
>> session. Once logged in, the lightdm (I guess it's using
>> pam_systemd.so) login service will also start systemd user session
>> and a session dbus daemon. The rest of Plasma follows.
>>
>> The problem is, that whenever I log out from Plasma, the systemd user
>> session isn't terminated and as such leaves the user bus daemon and
>> lots of services around, which makes shutdown hang (if I initiated
>> the shutdown, which will first initiate log out) for some time (90
>> seconds by default until it's forcibly killed by systemd) which I
>> rather find annoying. I can see the systemd user session is the
>> culprit, because I can see "Waiting for session for user 1000 to
>> terminate [timer]" or something like that.
>>
>> When I just log out, I can manually stop the systemd user session
>> using loginctl kill-user/kill-session (I am not sure which one I used
>> last time), which will terminate user bus and all the other services
>> from that session.
>>
>> Now, to the original question: Once PAM closes the session (once
>> logout is received), should systemd --user daemon terminate as well?
>> Currently, that's not the case on my system.
> 
> Which distribution do you use? Did you properly load the systemd bits
> in pam? Usually, the systemd user session should end as soon as pam
> closes the session - except there's still a process around (this is
> probably why KillUserProcesses improved the situation).
> 

This is Linux From Scratch, systemd is built by myself. See also my reply
to your other mail.

> My first guess is: Does your Xsession try to spawn dbus itself? Have you
> tried commenting it out? Should be in /etc/X11 or somewhere in the
> session files installed by lightdm.
> 

There's only one dbus user daemon. I have no XSession (cough, lightdm, cough),
and no files in /etc/X11 that start one.

> My Xsession files look if there's already a dbus around (probably
> provided by systemd user session) and only spawns one if there's none.
> 
> If you identify the problematic process you could try to kill it using
> KDE's shutdown scripts (look in "vi $(which startkde)" to see
> where it looks for shutdown scripts). It'll be a workaround but may
> help.
> 

Again, see my other reply.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20160123/5136d5ea/attachment.sig>


More information about the systemd-devel mailing list