Take a look at this: https://github.com/tmux/tmux/issues/428
Re:Systemd as tragedy
by erik_seaberg on Tuesday January 29, 2019 @06:54PM
(#19031151)
I see arguing but no consensus on what ought to be done.
My use case: I run a shell pipeline that will probably take all weekend to finish. On a POSIX box I start it with nohup. What do I do on a systemd box? Does nohup need a patch that doesn't exist yet?
There's a couple ways to work around the issue, you can just configure systemd to not kill processes that were in the user scope when the user scope is closed in which case it behaves exactly as it did before. Or if you want to keep systemd cleaning up hung applications but not e.g. some script that you typically ran with nohup you can just use systemd-run instead.
https://www.freedesktop.org/software/systemd/man/systemd-run...
In particular you'd probably want --user so that it runs it under your user instance of systemd and --scope so that it's all run under a scope for that command instead of just a transient service. For most uses of nohup you could literally just make it an alias for systemd-run --user --scope instead.
Re:Systemd as tragedy
by inferiorhuman on Tuesday January 29, 2019 @07:16PM
(#19031318)
I expect that the formal answer is that you should be running that within the service framework (be it systemd or other). My answer is: if you want POSIX-like behavior don't run it on Linux.
What is the actual workaround? Is there a patch that unbreaks nohup by passing cwd and env to systemd-run --user or something?