So I've been struggling with this for a few hours and everything I've found online leads to huge arguments about how systemd (back in 2016?) changed a default to kill all user processes on logout. Well that sounds ok, but it kills things like screen. screen has been used for many many years, specifically for the use of keeping something running after you logout.
They say the systemd default is enabled but it's up to distros to pick. Well I'm using a Debian container and it appears to be disabled by default but my screen session still gets killed as soon as I logout.
There have been a few suggestions, none have worked. Is this specific to being in a container?
It was suggested to add 'export XDG_RUNTIME_DIR=/run/user/$(id -u)' to .bashrc
Well that did result in something different, but still doesn't work.
I need to have screen continue to run on logout/disconnect. Honestly it's more the ungraceful disconnect I'm concerned with. Just because my desktop system disconnects/dies/locks shouldn't affect screen.
They say the systemd default is enabled but it's up to distros to pick. Well I'm using a Debian container and it appears to be disabled by default but my screen session still gets killed as soon as I logout.
There have been a few suggestions, none have worked. Is this specific to being in a container?
$ systemd-run --scope --user screen
Failed to connect to bus: $DBUS_SESSION_BUS_ADDRESS and $XDG_RUNTIME_DIR not defined (consider using --machine=<user>@.host --user to connect to bus of other user)
$ systemd-run --scope --machine=clickwir@.host --user screen
Execution in user context is not supported on non-local systems.
$ systemd-run --scope --machine=clickwir@.localhost --user screen
Execution in user context is not supported on non-local systems.
$ systemd-run --scope --machine=clickwir@localhost --user screen
Execution in user context is not supported on non-local systems.
$ systemd-run --scope --machine=clickwir@ --user ls
Execution in user context is not supported on non-local systems.
$ loginctl enable-linger
Could not enable linger: Connection timed out
It was suggested to add 'export XDG_RUNTIME_DIR=/run/user/$(id -u)' to .bashrc
Well that did result in something different, but still doesn't work.
$ systemd-run --scope --user screen
Failed to connect to bus: No such file or directory
I need to have screen continue to run on logout/disconnect. Honestly it's more the ungraceful disconnect I'm concerned with. Just because my desktop system disconnects/dies/locks shouldn't affect screen.