Bug#989317: systemd kill background processes after user logs out (#825394 regression)

Matt Corallo dbsdsfdog at mattcorallo.com
Tue Jun 1 15:25:40 BST 2021


Please see the issue description - `loginctl enable-linger` does not change the behavior. The suggestions in 
systemd-run's manpage for how to address this issue do not work.

On 6/1/21 07:15, Ansgar wrote:
> On Mon, 2021-05-31 at 20:37 -0400, Matt Corallo wrote:
>> [1] eg systemd-run --user -p "Delegate=yes" --unit=fuzzer -- lxc-
>> start --name fuzzer -- /usr/sbin/sshd -D
> 
> I think this is treated like a user .service unit.
> 
> So what happen should be: user logs out and no processes are left as
> part of the login session[*].  As a result the `systemd --user` session
> is shut down.  This causes all user units to be shut down, including
> the process started by systemd-run.
> 
> To keep user units running, you would need to have the `systemd --user`
> instance never shut down after logout which I don't think is the best
> default behavior.  Or some way to switch this on-demand.  This is half
> of what `loginctl enable-linger` does (but that setting also always
> starts the `systemd --user` instance for the given users which is not
> needed here).
> 
> Ansgar
> 
>    [*]: These processes are what "KillUserProcesses" are about AFAIU.
> 



More information about the Pkg-systemd-maintainers mailing list