Hacker News new | past | comments | ask | show | jobs | submit login

I'm not sure I understand, but it seems that systemd is correctly killing processes when the session ends. and that shell managers like screen and tmux had hacks to make them survive sessions ends in the past (remember when you had to use nohup screen?). they seem to simply have asked for tmux to add their flavor of nohup to the start up check too.



It depends on what you mean by 'correctly'.

Processes using daemon(3) have been around for 21 years, and are used to certain behaviour. Some of those processes behave badly.

systemd is adding functionality to kill all of a user's process when the session ends, no matter what. The problem is that they don't have any way of telling which processes are behaving badly and which ones aren't, so they're telling everyone (e.g. tmux, screen, etc) that they have to implement changes or they'll be killed too.

Fundamentally, the problem isn't whether the systemd behaviour is right, the problem is that it's a huge breaking change and they're asking everyone else to work around the shortcomings of their approach.

> shell managers like screen and tmux had hacks to make them survive sessions ends in the past

tmux, screen, etc. didn't have hacks to survive sessions; they just did, automatically, because of how things worked. systemd is asking the to add hacks to make them survive session ends from now on, when running specifically on Linux under systemd 230+, because systemd is going to change default behaviour for other people's processes.


> systemd is adding functionality to kill all of a user's process when the session ends

They actually added the functionality over 5 years ago. Which is when the tmux project was approached to accept a patch to support pam (not systemd) in order to not be killed.

http://tmux-users.narkive.com/LXp72CHV/pam-support-in-tmux

All they did recently was try to change the default configuration to enable the feature by default.


... as well as, as pointed out twice on this page, not answer in all those years the question that Nicholas Marriott posed about why they are not pushing this at GNU libc, so that everyone can benefit from a better daemon() function that escapes the systemd login session as well as the kernel's login session.

> Shouldn't this code be part of glibc instead of tmux? -- Nicholas Marriott, 2011

> If you want to change how processes daemonize, why don't you change how daemon() is implemented [...] ? -- Nicholas Marriott, 2016

* https://news.ycombinator.com/item?id=11798173

* https://news.ycombinator.com/item?id=11798328


Tomorrows systemd hate post:

Systemd developer asks libc to add systemd specific code


That's just unfounded silliness. There's no reason to suppose that, and plenty of reason (given that they've actually had systemd-specific stuff, such as subreapers, fairly uncontroversially put into the kernel in years gone past) not to.


It may be silly, but I think there is plenty of reason to think that if systemd developers proposed adding systemd support to daemon(3) there would be an even larger negative response.

This whole comment thread is about an optional feature that has existed for 5 years and only recently had its default value changed. You are not affected unless you are running a bleeding edge distribution that has already upgraded to a version of systemd released 5 days ago.

I don't think a more long term solution will present itself in the near future and most likely what will happen is that the default will get changed back to disabled.


This feature has its place in some cases. For example, a public terminal that wants to make sure that users didn't leave anything running. I'm fine with this feature existing. I'm not okay with it becoming the default option. Changing the default behavior implies some endorsement of it for general use, not just in special cases.


I would suggest you learn something about Unix before spousing such opinions, because I don't know where to even begin

nohup is not a hack

What systemd is offering has nothing to do with nohup, it's not "a flavour" of nohup it's a completely different thing

Systemd is not correctly killing processes, this was NEVER DONE LIKE THIS, they decided this out of a whim because apparently Gnome can't do the right thing (how surprising)


Heh--it's like nohup(/daemom), except you make a SOAP call through some middleware to beg some more middleware for mercy so you can do the thing your user asked you to do, because everyone's being punished for a few programs' poor use of the old, more portable API. (I exaggerate, slightly.)

I'm not looking forward to what comes next when Gnome breaks through the new system.


I prefer to keep the mystery and not know all about my opinions from the start. It's the small discoveries that keep the flame of love alight in our marriage.


I do not want systemd to kill processes that have invoked daemon() on session termination. If I wanted it to be killed when I logged out, I wouldn't have invoked daemon()!




Applications are open for YC Summer 2019

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: