Leonard/Janis Robert König on Nostr: Today's Linux tip: Most GUI/non-server(!) distros default to KillUserProcesses=yes by ...
Today's Linux tip: Most GUI/non-server(!) distros default to KillUserProcesses=yes by now¹, so SSH-ing to a desktop and opening a tmux/screen to do something will still kill the processes when SSH drops. In case you don't want this behavior for a single command, you can just do something like:
```
systemd-run --scope --user tmux
```
This will persist throughout the whole user session.
If you also want this to persist over a complete log-out (i.e., even logging out on the GUI), you may need to `loginctl enable-linger`, too.
¹ For good reason, it's what most people would expect. Yes, it breaks existing behavior but if we want Linux to be on the desktop, it shouldn't behave like a server running a GUI. If you need different behavior, have a look at `systemd-analyze cat systemd/logind.conf` and check the files you need to touch to change this.
Published at
2024-12-17 15:38:52Event JSON
{
"id": "0c2563e5a86b6bc4b8eb51e3b8edfae0ce8623a4ec30c3de3b3187b3e79926f5",
"pubkey": "e2758e166e0556cc0d19edd264ab6628420acccdfb52a575f6ddd7cb79a056e4",
"created_at": 1734449932,
"kind": 1,
"tags": [
[
"proxy",
"https://todon.eu/users/ljrk/statuses/113668910756263570",
"activitypub"
]
],
"content": "Today's Linux tip: Most GUI/non-server(!) distros default to KillUserProcesses=yes by now¹, so SSH-ing to a desktop and opening a tmux/screen to do something will still kill the processes when SSH drops. In case you don't want this behavior for a single command, you can just do something like:\n\n```\nsystemd-run --scope --user tmux\n```\n\nThis will persist throughout the whole user session.\n\nIf you also want this to persist over a complete log-out (i.e., even logging out on the GUI), you may need to `loginctl enable-linger`, too.\n\n¹ For good reason, it's what most people would expect. Yes, it breaks existing behavior but if we want Linux to be on the desktop, it shouldn't behave like a server running a GUI. If you need different behavior, have a look at `systemd-analyze cat systemd/logind.conf` and check the files you need to touch to change this.",
"sig": "3c780d10176998b7ad91e1eceea844af92b4f74065c884bcd90b3fad47d83e7a8563ab8209027e7b0c204bbcfb26871f1105f906d24516142183d57a1aae1219"
}