HeadlinesBriefing favicon HeadlinesBriefing.com

Systemd Linger and Kill User Processes Explained

Hacker News •
×

One controversial systemd feature kills user processes on logout, initially affecting screen/tmux/nohup. In recent Debian releases, systemd-logind defaults to allowing processes to persist. The `/etc/systemd/logind.conf` KillUserProcesses option can enable killing, with exclusions for root. A systemd unit can start screen to prevent killing on logout. This helped when KDE processes like akonadi lingered after logout, reducing issues without rebooting.

The "linger" feature is widely believed required for screen/tmux/nohup, but in Debian that's not true. In hundreds of desktop support cases, no users needed linger for terminal multiplexers while also needing auto-kill on logout. Linger is controlled via loginctl enable-linger/disable-linger (or as root for other users). Checking status requires `ls /var/lib/systemd/linger`.

On near-default Debian, processes survive logout; linger only starts user programs before login. An install script automatically enabled linger for an LLM testing account. Benefits include WiFi connecting on boot without login (useful when X11/Wayland breaks), and Pipewire/Bluetooth starting early for faster login.