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 comment

81

u/cbmuser Debian / openSUSE / OpenJDK Dev May 28 '16

The automatic session clean-up is an actual useful and necessary feature. What's wrong with adding an optional code path on Linux in tmux which can make use of modern features of the plumberland?

79

u/HowIsntBabbyFormed May 29 '16

If systemd is going to take over so many aspects of a Linux install that all sorts of different programs need to add systemd specific code paths, then maybe that functionality should be wrapped in some core library/standard that is implemented by systemd (and possibly others). Then programs will just call that standard function.

Put it in libc and have it specified in POSIX.

18

u/LvS May 29 '16

I expect this to happen. Just not right now while people are still figuring out the right thing and changing things around to find the best way possible.
Nobody wants to standardize another creat() call.

So in 10 or so years, systemd features might be part of POSIX.

3

u/[deleted] May 30 '16

can't they find out the best way without breaking applications?

3

u/flying-sheep May 30 '16

probably not.

i mean, if they wouldn’t change the default, nobody would change the setting because it would break tmux. and tmux wouldn’t change anything because “you can just leave the setting at default value then”. after this we’d have an useless setting that can’t be used.

OK, this is speculation, but do you think it would go differently?

5

u/LvS May 30 '16

No. Because there are two types of applications: deamons that are meant to exit with the user (like the d-bus session or ssh-agent) and deamons that are not meant to exit with the user (like screen). And currently there is no way applications can differentiate between these two states.

7

u/[deleted] May 29 '16

Put it in libc and have it specified in POSIX.

It is called daemon(3)

5

u/flying-sheep May 30 '16

daemon has no semantic information about if the spawned daemon should survive closing the user session or not.

  • ssh-agent is a daemon that should die
  • tmux is one that should survive
→ More replies (1)

1

u/cbmuser Debian / openSUSE / OpenJDK Dev May 29 '16

If systemd is going to take over so many aspects of a Linux install that all sorts of different programs need to add systemd specific code paths, then maybe that functionality should be wrapped in some core library/standard that is implemented by systemd (and possibly others). Then programs will just call that standard function.

But this is actually what's happening here.

Put it in libc and have it specified in POSIX.

Then it will still be available on Linux only, what's the point?

→ More replies (1)
→ More replies (2)

10

u/[deleted] May 29 '16

.. modern features ..

SIGHUP is not a modern feature

6

u/TechnicolourSocks May 29 '16

It is if we rewrite it as systemd-sighupd and make it function via dbus!

3

u/tso May 29 '16

How about going one better and create systemd-shd? /s

→ More replies (1)

42

u/Lennartwareparty May 29 '16

It is a useful feature, and it was already there prior to this version. It could be turned on before, and looking at it, Arch and Debian are going to ignore upstream here (which is unusual for ARch, showing how dumb they think this is) and keep it off by default.

All that happened in v230 is that a default of off was flipped to on, nothing more.

What people criticize is that a default was change breaking behaviour and biting people who don't expect it. The feature is useful for system administrators who want it of course.

5

u/tso May 29 '16

A useful feature that already existed in base behavior of both the terminal and X. What changed recently was some dbus behavior that meant dbus started processes were no longer being shut down. This inconvenienced some systemd dev, so out comes the big gun.

https://github.com/systemd/systemd/issues/2900

1

u/learath May 29 '16

This makes way more sense now.

34

u/imMute May 29 '16

Personally, I think upstream projects like systemd should keep changing defaults to what would be ideal on a modern system that doesn't need to keep previous behavior. Let the distros override the upstream defaults (they're going to do that anyway).

On another note, I never would have known this feature even existed until reddit kicked up a stink about it. Now I know. :)

10

u/MertsA May 29 '16

(they're going to do that anyway)

That's their entire job, that's what makes a distro a distro. If they didn't what would be the difference between Arch, RHEL, and Debian?

3

u/xiongchiamiov May 29 '16 edited May 29 '16

Most of the time, the package manager used, the release strategy, and what's pre-installed.

16

u/Lennartwareparty May 29 '16 edited May 29 '16

I didn't know of this exact feature myself of systemd. But I knew it had something like this because everything has it.

People in this and other threads act like this is some revolution, systems have been configurable for I don't know how long to not allow processes to login users who don't currently have a session.

Quite a few companies set up their stuff like that for obvious reasons, very important in say an internet café, nothing new about it.

Very bad bad bad idea however in a company, university, home desktop or really any place where the people who run processes aren't complete strangers and still people whom you employ to get work done for you. Killing all their processes when they log out is close to resetting their filesystem when they do, great for things like internet cafés but bad for everything else.

→ More replies (10)

3

u/jbicha Ubuntu/GNOME Dev May 29 '16

Arch and Debian are going to ignore upstream here

[citation needed]

Debian testing already has systemd 130 and it does not override the new default behavior. But it does look like Arch is overriding. There's a chance that's temporary until tools like tmux are updated for the change.

4

u/jbicha Ubuntu/GNOME Dev May 30 '16

It does indeed look like Debian will be disabling the feature in the next update but the reversion might be temporary until select tools have been updated to work well with the change.

6

u/aelog May 29 '16

What people criticize is that a default was change breaking behaviour and biting people who don't expect it

This doesn't make sense. They are changing a default in a new major release and they are documenting this change. You don't expect changes in a minor/bugfix release and this is not the case.

→ More replies (1)

11

u/tetroxid May 29 '16

I disagree. If some programs are supposed to exit on logout but don't, then these programs are broken and need to be fixed. Adding a systemd-killuponexitd is not a solution but a workaround, and a bad one at that because it breaks many things like tmux and screen.

3

u/tesfabpel May 29 '16

I don't think that would be a reliable system if such programs are able to do that... the system should be in control of everything...

6

u/MereInterest May 30 '16

The system is in control, and listens to requests from the program.

When a user disconnects, SIGHUP is sent to all running processes, indicating that there was a disconnect. By default, a program then dies. If a program has intentionally gone out of its way to catch SIGHUP, it is telling the operating system that it should continue living as a background process. For systemd to then go ahead and terminate the process despite the request not to terminate is ridiculous.

→ More replies (5)
→ More replies (1)