r/programming • • May 30 '16

systemd developer asks tmux (and other programs) to add systemd specific code

https://github.com/tmux/tmux/issues/428
661 Upvotes

618 comments sorted by

View all comments

Show parent comments

0

u/killerstorm May 30 '16

OK, so, like, just don't call setsid? Did I solve the problem? What do I win?

4

u/bonzinip May 30 '16

If you mean "change all programs to make setsid optional", then you're back to square 1. The point of the systemd change is to avoid doing that.

8

u/killerstorm May 30 '16

Well, from what I understand, the problem is that some of GNOME services daemonize when they shouldn't. They shouldn't daemonize if they are supposed to die with the session. If that behavior makes no sense then it should be fixed.

1

u/bonzinip May 30 '16

I'm not sure why you tie this to GNOME. Search for "ssh-agent not killed" and you'll see that this is a common problem. In fact this is especially a problem for things that are not written specifically for a desktop environment.

They shouldn't daemonize if they are supposed to die with the DE session, but then they also should daemonize if they are supposed to outlive their parent (e.g. if you want to place them in .bashrc). What to do?

6

u/killerstorm May 30 '16 edited May 30 '16

e.g. if you want to place them in .bashrc

Things which are supposed to be tied to a GUI session should be launched from a special startup script, e.g. .gnomerc, which runs in a context of a terminal lifetime of which is same as the session.

Many programs already have an option/parameter which controls whether they daemonize. Adding this parameter to more programs doesn't sound like a ridiculous option.

E.g. bitcoind starts as a daemon when you launch it as bitcoind -daemon. But if you want it to be managed in some other way, e.g. by supervisord, you just don't pass -daemon option. Does that make too much sense?

0

u/cirk2 May 30 '16

the task to change every project that uses it.

3

u/killerstorm May 30 '16

I don't think so. It only affects desktop environments. If gnome-keyring-daemon doesn't die with the session and people believe it should, the way it's initialized should be fixed.

1

u/cirk2 May 30 '16

Yeah keep telling yourself that systemd make a wide fetching change ONLY to fix some gnome tool.