Systemd Linger

July 24, 2026July 24, 2026

etbeSystemd Linger

Linux

Linux

Killing Processes

One of the features of systemd that is most controversial is the option to kill user processes when the user logs out. That initially killed screen/tmux/nohup processes too. In recent Debian releases the default configuration of systemd-logind (the login manager for systemd) is to allow processes to keep running, the configuration file /etc/systemd/logind.conf has an option KillUserProcesses that can be enabled to have user processes killed. If you do that then there are options to only kill processes for certain users and to exclude some users (default to excluding root). If using that option you can apparently use a systemd unit to start screen which prevents it being killed on logout.

This is a very handy feature for some particular user cases. One situation was that I was supporting some people who weren’t very good at computers on a system running KDE and some KDE processes would linger. So the option of logout and login again to deal with an issue of akonadi or some other KDE service misbehaving didn’t work. On that system I enabled the option to kill user processes which reduced the number of problems they had while not requiring rebooting.

It is widely believed that the “linger” feature is required to allow screen/tmux/nohup to work, in Debian (and probably most distributions) that is not the case. It might be that some combinations of configuration requires “linger” to allow screen/tmux to work but I am not interested in trying to discover them. Of all the people I have directly supported for Linux desktop use (which numbers in the hundreds) none of them have had the ability to use screen/tmux and also the cluelessnes that makes me want to automatically kill their processes when the logout.

Controlling Linger

You can enable and disable “linger” for your own account with the following commands if polkit is installed and in a typical configuration:

If running as root you can enable and disable it for another user with the following commands:

There doesn’t seem to be any documented way of discovering if an account has linger enabled or for listing accounts that have it, it seems that “ls /var/lib/systemd/linger” is the only option.

Linger on Debian

On a Debian system with close to default settings the processes won’t be killed on logout and the only difference “linger” makes is to start programs in the user’s context BEFORE they login. A friend was recently testing out a bunch of LLM programs on one of my servers and the account he used for that ended up with “linger” enabled, presumably one of the install scripts he ran was written on the assumption that enabling linger was necessary for nohup to work and it did so automatically without being asked.

One benefit I’ve found from this behaviour is on my laptop. I’m currently testing out new SE Linux policy on my laptop and rebooting it a lot. When I enabled linger on my account it caused the laptop to connect to wifi on boot without needing to login which is convenient. I can then ssh to it even when the X11/Wayland login configuration is broken.

I will leave it enabled after finishing these tests. Having background processes like Pipewire and Bluetooth start before I login will presumably make things slightly faster when I do login.

Related posts:

Systemd Notes A few months ago I gave a lecture about systemd...

Systemd Notes

Ethernet Interface Naming With Systemd Systemd has a new way of specifying names for Ethernet...

Ethernet Interface Naming With Systemd

Systemd, Mobile Linux, and Containers I’ve had some problems running apps I want on my...

Systemd, Mobile Linux, and Containers

systemd – a Replacement for init etc The systemd projecct is an interesting concept for replacing init...

systemd – a Replacement for init etc

Systemd Hardening and Sending Mail A feature of systemd is the ability to reduce the...

Systemd Hardening and Sending Mail

Leave a Reply

You must be logged in to post a comment.

logged in

Related Post

ZFS on Debian/Wheezy

ZFS on Debian/Wheezy

[July 31, 2012 July 31, 2012

|](https://etbe.coker.com.au/2026/07/26/)

[etbe ZFS on Debian/Wheezy

|](https://etbe.coker.com.au/author/etbe/)

[13

Comments |](https://etbe.coker.com.au/2012/07/31/zfs-debian-wheezy/#comments)

View MoreView More

Differences between Distribution Kernels

Differences between Distribution Kernels

[January 16, 2008 January 16, 2008

|](https://etbe.coker.com.au/2026/07/26/)

[etbe Differences between Distribution Kernels

|](https://etbe.coker.com.au/author/etbe/)

[3

Comments |](https://etbe.coker.com.au/2008/01/16/differences-between-distribution-kernels/#comments)

View MoreView More

Write Intent Bitmaps

Write Intent Bitmaps

[January 28, 2008 January 28, 2008

|](https://etbe.coker.com.au/2026/07/26/)

[etbe Write Intent Bitmaps

|](https://etbe.coker.com.au/author/etbe/)

[2

Comments |](https://etbe.coker.com.au/2008/01/28/write-intent-bitmaps/#comments)

View MoreView More