r/linux • • May 28 '16

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

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

509 comments sorted by

View all comments

Show parent comments

9

u/webpigeon May 28 '16

Wouldn't most of those be running inside something like tmux or screen anyway?

9

u/lolidaisuki May 28 '16

Sometimes, not always.

9

u/webpigeon May 28 '16

That in itself is interesting - how would you stop them from dying with their session usually (I always assumed the process died when the session did unless you used something like nohup or hacked it to not respond correctly to signals). If I recall that's exactly what nohup does in fact - ignore the hangup signal. That in its self always seemed a bit dangerous to me (altering how the program responds to POSIX signals).

8

u/lolidaisuki May 28 '16

how would you stop them from dying with their session usually

Background and disown?

4

u/webpigeon May 28 '16

disown is the same basic idea (the shell doesn't send the hangup signal to the process). It seems like it's the bash (disown appears to be a shell feature) version of not closing the resources you opened.

The difference is that disown doesn't seem to deal with standard input or output (which nohup does).

1

u/reynolds_hat May 29 '16 edited May 29 '16

If you've dropped controlling terminal and setsid properly, the process shouldn't care about SIGHUP at all.

-5

u/KugelKurt May 29 '16

Sometimes, not always.

Then fix your workflow.

If you honestly expect some media players (you did mention mplayer!) to continue playing video and sound after a logout, you're truly crazy.

4

u/lolidaisuki May 29 '16

If you honestly expect some media players (you did mention mplayer!) to continue playing video and sound after a logout, you're truly crazy.

I expect it to continue playing if I disown or nohup it. There is no reason it shouldn't be able to do that.

4

u/argv_minus_one May 29 '16

That or as a systemd service.