3 ms·
It's not "platform specific code", it's breaking historical behaviour. Killing user processes after logout (when they have been set to not do so, through nohup
by raverbashing 10y ago
It's not "platform specific code", it's breaking historical behaviour.
Killing user processes after logout (when they have been set to not do so, through nohup usually) is not sensible.
Edit: clarification
- danudey 10y agoKilling user processes which aren't meant to stay alive after the user logs out is sensible. Killing all user processes unless they update their code to implement a new API just for this one platform, because of a breaking change to a 21-year-old API, is not sensible. In other words, if this functionality had been added 21 years ago as well, a lot of mess and confusion would have been avoided and we'd all be happier, but since it didn't the systemd guys are trying to implement it retroactively, which is going to break a lot more stuff than tmux/screen/etc.
- tremon 10y agoKilling user processes which aren't meant to stay alive after the user logs out is sensible Only if you can succesfully determine which ones the user wants to keep running. Otherwise it's just breaking stuff, as this story shows. if this functionality had been added 21 years ago as well, a lot of mess and confusion would have been avoided Not really. You will always have sub-standard software that doesn't adhere to the system's declared semantics, and just goes by "what works" (ask the WineHQ guys). Any API that has been around for 21 years will have corner cases where software just breaks. That does not mean you're then free to break the old API yourself.
- embik 10y agoI'd like to respectfully disagree here. IMHO, killing user processes after logout is totally reasonable and something I would expect to happen on desktop computers. On servers this might be a bit more difficult, but I like the idea of having to explicitly allow user processes to run outside of the session's scope. That keeps my server used by multiple people clean. I'd argue most sysadmins could simply deploy an alias to their servers for specific applications and be done with it. edit: If you're already using a specific command to tell the application to stay alive (e.g. nohup), you can use the "new" systemd command as well. nohup never related to a "session" scope because that didn't really exist before systemd. A new command _does_ break historical behaviour, but thanks god we do that from time to time. That's how innovation works.
- sklogic 10y ago> killing user processes after logout is totally reasonable How is it so? I cannot see a single legitimate justification for such a stupid behaviour. > "session" scope Exactly. There is no such a thing, and it should not exist, it's a totally alien concept to anything Unix.
- icebraining 10y agoSure there is, that's why nohup had to be invented, because people wanted to leave some processes running after logout. (By the way, I disagree with this request to change tmux)
- sklogic 10y ago> after logout Not after "logout", but after terminal is detached. For whatever reason. There is no such a thing as "logout".
- icebraining 10y agoWhen I log off (by giving the logout command) the shell will print ‘logout’ and execute commands from the file ‘.logout’ if it exists in my home directory. After that the shell will terminate and UNIX will log me off the system. - Bill Joy, An Introduction to the C shell (1978) The concept is commonly called logout, even if you prefer to call it something else.
- justinsaccount 10y agoThat written in a world where you had one terminal on your desk or one modem to dial into the system. If you had two logged-in terminals on your desk and ran 'logout' on one of them, are you still logged in?
- digi_owl 10y agoAnd thus we are back at square one. Dbus devs apparently asked themselves the same, added the concept of a user session to dbus alongside the existing login session. Gnome code happens to get the two confused (or dbus fails to properly tell one form the other, likely by mixing old and new behavior). Systemd dev notices leftover Gnome processes, and convince Poettering to flip the safety on the big gun. All this while giving crap all about unix conventions...
- okket 10y ago[stupid discussion. deleted]
- JdeBP 10y ago> If you really need to run longer, tell it to the system. ... with nohup. Which now doesn't work. * https://news.ycombinator.com/item?id=11782364 https://news.ycombinator.com/item?id=11782364
- protomyth 10y agoHow did they justify breaking nohup? I thought it was a common usage pattern to nohup long running jobs before logging out.
- digi_owl 10y agoExpect them to call it a broken concept, as they did with su.
- cnvogel 10y agonohup (no hangup) just concerns itself with the controlling TTY of a process. By running "nohup", you are not passing on the intent on why this process should be kept alive, and for how long. Traditionally the answer was "forever", but I think it's reasonable to implement lifetimes "for this session", "once the last of my sessions has ended, probably after a timeout" and "forever". (Added:) The first runtime, in systemd parlance (I think), would be the session scope, the second runtime would be the user service and the third... well, something different, as you'd pass on things (group memberships, environment variables, namespaces) from your shell/session into a long-lasting service. One probably would want to extend the "once the last of my session has ended" state to the runtime of the "run forever" command. Most non-technical users, I guess, would really prefer one of the first two lifetimes to be the default. As being able to start from a clean state after logging in- and out is rather convenient. As nohup, in an interactive shell, is used for the third "keep running forever" option, I think it would be reasonable for distributions to alias it to the relevant "systemd-run..." command for all default shells. Then user-expectations would be perfectly met (and scripts will still run the binary /usr/bin/nohup).
- derefr 10y agoSure it is; we do it all the time. When a TTY quits, everything in the process group attached to that TTY is sent a signal to quit; this is the original point of SIGHUP. A systemd session is a generalization of that concept, where the "terminal" is anything someone has logged into—a terminal session, or an SSH session, or a GUI session. Sort of a process-group-group. It tries to retain these semantics.
- digi_owl 10y agoWhile ignoring the hell out of the actual mechanics, thus breaking behavior that has been with *nix for decades. What you are describing is systemd becoming a kernel sitting on top of a kernel, second guessing the actual kernel.