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

0

u/[deleted] May 28 '16

[deleted] — view deleted 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?

→ More replies (1)
→ More replies (7)

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

→ More replies (1)

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?

→ More replies (1)

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.

→ More replies (2)

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.

→ More replies (7)
→ More replies (1)

20

u/rain5 May 28 '16

hm? I did post that comment

0

u/[deleted] May 28 '16

[deleted] — view deleted comment

12

u/rain5 May 28 '16

ah my bad, should have stated that in a comment!

To be fair, are you expecting /wanting systemd devs to rollback to the previous methodology

I really thought this was a bug when I first learn about it! I was surprised that it's actually a new idea they want to change they way linux works for the better (in their mind) - but I think a lot of people don't agree with idea that this improves things. I think Lennart said it was a security problem to leave the processes up, but I don't see why. Hopefully they will listen to their users!

0

u/[deleted] May 28 '16

[deleted] — view deleted comment

15

u/mogsington May 29 '16

It's actually the other way round.

At the moment it's trivial to run a process which I know will keep running after I log out. I can then close down a whole heap of running processes, log out, turn off the monitor and go to bed. That single process is running in the relative safety of my user account and isn't insisting I stay logged in to a desktop session full of other processes all night. It isn't a significant security risk.

Assuming one day the new systemd default did become the standard for Linux distro's (I know it isn't, but lets for the sake of argument imagine it has one day become the default) .. A lot of "Do it the easy way" users would instead leave a terminal running in a graphical session over night with all the sub-processes that entails churning away as potential security risks, because visible to them, the default is for everything to die if they log out.

So your "why do they need processes still running?" question becomes .. largely, they don't. And as it stands it's trivial to absolutely minimise what they do leave running. If this default ever did achieve wide spread adoption, they would probably leave dozens to hundreds MORE processes running just to keep that one thing going that they wanted running over night.

It isn't up to any of us to dictate how a particular Linux user actually uses Linux. We can suggest safer / more sane ways of doing things. But it has always been a platform rich in choice for how the end user actually decides to do things for themselves. Hypothetical arguments on "should" & "probably" and "I can't imagine why" are bound to be limited to one users particular viewpoint concerning the things they themselves often do and utterly ignore a lot of things they never do and never thought of doing.

→ More replies (2)

5

u/Lennartwareparty May 29 '16

As for the change itself - if a user has completely logged out of a system, why do they need processes still running tying up resources and leaving (potential) vectors for attack?

You assume that all processes are interactive, a lot aren't. A lot of processes are long-running processes that will eventually produce a result, think of a compilation or calculating a complex simulation.

19

u/xkero May 28 '16

why are you running that server as the user?

Because you're a developer trying to do your job and you don't have root access to your work computer.

20

u/sub200ms May 28 '16

Because you're a developer trying to do your job and you don't have root access to your work computer.

You can just use systemd-run or even systemd --user. The latter is for user .services with full unit-files.
So you don't need root if you service don't need it.

→ More replies (26)
→ More replies (20)
→ More replies (9)
→ More replies (2)
→ More replies (60)