There is ONE thing I like about systemd

The place to discuss Linux and Unix Operating Systems
Forum rules
Behave
Post Reply
User avatar
Grogan
Your Host
Posts: 3211
Joined: Sat Aug 21, 2021 10:04 am
Location: Ontario, Canada

There is ONE thing I like about systemd

Post by Grogan »

A while back, systemd made killing user processes on logout the default. I very much like that behaviour, because of stupid stuff like desktop daemons (XFCE has a few, though not as bad as KDE or Gnome) that stay running after logout. Not only user processes, but user IPC resources. (for example Steam leaves a bunch of shared memory that doesn't get recovered when exiting, and starting it again doesn't reuse that space)

The default is 10 seconds, but I have it cut down to 5 so that by the time I logout and log in again, it's done. I log out in between X sessions when I switch between XFCE and IceWM and I also log out and in again when I'm finished with Steam. It doesn't get to waste even 200 Mb of RAM.

These settings are in /etc/systemd/logind.conf. The commented settings are supposed to show the default state, but it shows it as "no" in the unedited, commented file even though the default is yes. I changed it to yes for the sake of correctness, and you can see UserStopDelaySec that I changed to 5

Code: Select all

[Login]
#NAutoVTs=6
#ReserveVT=6
KillUserProcesses=yes
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
UserStopDelaySec=5
...
...
#RemoveIPC=yes
You don't have to do anything to enjoy this behaviour.

A system using sysvinit scripts has nothing that does this.
User avatar
Zema Bus
Your Co-Host
Posts: 1955
Joined: Sun Feb 04, 2024 1:25 am
Location: Arizona

Re: There is ONE thing I like about systemd

Post by Zema Bus »

Interesting.
Post Reply