On Mon, 2020-02-10 at 14:37 +0100, chrysn wrote: > On Mon, Feb 10, 2020 at 11:25:29AM +0100, Michael Biebl wrote: > > I assume your GNOME session is managed by systemd --user, i.e. > > gnome-session is modelled around systemd --user. > > > > Might be that is gnome-session that triggers the cleanup of the > > session/processes. > > > > You could try with a more minimal desktop session, like openbox, and > > start tmux in a xterm there and test if that survices a logout (it should) > > In openbox, I could indeed not reproduce this behavior in the sid system > (Opening xterm via right-click / system / xterm, logging out via > right-click / ...) on a first attempt.
If I start an xterm via Alt-F2 in gnome, the xterm process runs in a cgroup like gnome-launched-xterm-489694.scope. gnome-terminal or an xterm started in gnome-terminal run in the gnome-terminal- server.service cgroup. I expect openbox doesn't do this and processes started by openbox run in the same cgroup as openbox itself. `systemd-cgls` is useful to see how processes are organized into cgroups. The gnome-launched-*.scope has KillMode=control-group, so all processes including background processes like tmux get killed when the unit gets stopped (systemd --user show -p KillMode gnome-launched-....scope). gnome-terminal-server.service has KillMode=process which doesn't kill background processes when the unit gets stopped. I would guess that the unit openbox runs in also has KillMode=process. Ansgar