You are not logged in.

#1 2018-03-06 11:55:02

Registered: 2017-08-23
Posts: 4

[SOLVED]Stopping systemd --user at logout *without* KillUserProcesses?

I read in the wiki

the pam_systemd module automatically launches a systemd --user instance when the user logs in for the first time. This process will survive as long as there is some session for that user, and will be killed as soon as the last session for the user is closed

Ok, that's exactly what I want. However, that's not what I observe. If I boot, login as my user ("fran"), logout, then login as root and run htop, I see "fran"'s systemd --user instance still running, with its corresponding services also running.

I read in the wiki that it can be caused by enable-linger, but that's not my case. I explicitly ran

# loginctl disable-linger fran

and /var/lib/systemd/linger is empty. Still, the systemd user sesion lingers after logout.

Is there any way to force systemd to stop? Note that I don't want to enable KillUserProcesses in logind.conf: I still want my tmux/screen/nohup processes to remain (without starting them with systemd-run --scope --user), but systemd --user and its services stopped.

Is this possible?


UGH, sorry, I've found the reason right after posting this (and after one hour looking for the solution roll). If there is any process left running after logout the session does not stop, and systemd --user remains. In my case the culprit was urxvtd, which I start with openbox. If I kill urxvtd after logging out when I'm logged as root I can see the systemd user instance finishing a couple of seconds afterwards. So it does work as expected.

Last edited by Fran (2018-03-06 12:08:42)


Board footer

Powered by FluxBB