Am 07.06.2021 um 21:20 schrieb Matt Corallo:
Is there any further information I can provide to help debug this (or should it get a -moreinfo)?Note that of interest may be that the workaround of spawning in a screen session only works if lxc-start is passed the -F command which places it in the foreground (though sshd still gets the -D option running inside the container).
Let me elaborate a bit more what's happening here.A systemd --user session (user session) is typically tied to a login session. As long as you have 1 (or more) login sessions you have a single (reference counted) user session. Once the last login session stops (has no more processes) the associated user session is stopped as well (unless you enabled lingering [1]).
Now, if you start a screen session inside your login session, you artifically keep your login session alive after loggin out (KillUserProcesses=no prevents screen from being killed).
As a result, your user session also kept alive as well. Hope this clarifies. Michael[1] Linger will start the user session when the system boots and keep it always active. Which is why it's not a good idea to enable this globally.
OpenPGP_signature
Description: OpenPGP digital signature