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

-2

u/totallyblasted May 28 '16

So, buggy behaviour is ok as long as it is sometimes intentional?

Ima gonna start writing to NULL pointers and call it intentional now. Why even bother fixing when you can simply insert intentional behaviour

6

u/lolidaisuki May 29 '16

So, buggy behaviour is ok as long as it is sometimes intentional?

Having background processes is not buggy behaviour. However killing everything is.

-1

u/totallyblasted May 29 '16

There is a big difference between running and unwanted remnant.

3

u/lolidaisuki May 29 '16

There is a big difference between running and unwanted remnant.

Yes. One is common, and one is very rare.

1

u/totallyblasted May 29 '16

Yet, it is much simpler handle first properly than avoid the second

10

u/Lennartwareparty May 28 '16

No, it's by definition not buggy behaviour if it's documented and intended.

A bug is behaviour of a program that is against documentation and intention. Calling behaviour you simply don't agree with a 'bug' is ridiculous.

-5

u/totallyblasted May 28 '16 edited May 28 '16

I will document my writing to NULL as well... that makes it ok, doesn't it? And since I did those intentionally, that makes it even better.

Even if it is intended and documented, if it goes out of scope of how it should work... it is not ok. Something should either be session or be software, not something in between. And if you need to run something in the background, there are far easier and more acceptable ways than cheating the session. Just being able to cheat session to do that is a bug. In case of problems like this, correct solution would be that tmux handed out its own sessions trough proxy while running in the correct userspace background which does not depend on user session. But, hey as long as it works... isn't it so? Off course, implementing it correctly is much more work than just doing the half assed way

When behaviour deviates so much it needs special treatment, it is just a case of lazy design

8

u/Lennartwareparty May 28 '16

I will document my writing to NULL as well... that makes it ok, doesn't it? And since I did those intentionally, that makes it even better.

Yes, because then people know it's intentional and can criticize you on bad design.

No one says that it's a feature, not a bug automatically makes it a good idea. But it does automatically make it a non bug.

Even if it is intended and documented, if it goes out of scope of how it should work

No it doesn't? Being able to continue to run processes while logged out was one of the most powerful multi-processing features of Unix where users could log in, start a process, not hog the terminal for others while they go do something else and then come back when the process is finished. Being required to be logged in for the entire duration of that would be a terrible idea. HUP already exists explicitly to clean up processes that are not intentionally left running. This is very good design.

it is not ok. Something should either be session or be software, not something in between.

How session not software?

And if you need to run something in the background, there are far easier and more acceptable ways than cheating the session. Just being able to cheat session to do that is a bug

There is nothing 'cheating' about it, this was intentional and documented and downright necessary behaviour of Unix from the start. nohup to avoid the HUP signal from being sent when you log out was made for this.

-3

u/totallyblasted May 28 '16

No it doesn't?....

You do know what this is about? Don't you? It is about user session, basically just changing the default setting of what happens when you log out. This is not about setting global defaults and run for world domination. And setting this on yes causes that when you log out of desktop everything is killed

How session not software?

Every hammer is a tool, yet not every tool is a hammer. Go figure

4

u/Lennartwareparty May 29 '16

You do know what this is about? Don't you? It is about user session, basically just changing the default setting of what happens when you log out.

Yes, it's purely changing a default setting, and yes, you could turn it on before this. That doesn't argue in favour of your point that you argue that processes continuing to run after log out is some-how a 'bug' or unwanted design. It's very wanted and very intentional to be able to do that.

This is not about setting global defaults and run for world domination.

You sure? Because I was pretty sure that this was some-how linked to the Martian takeover alliance with the Hilter zombie risen from the dead?

And setting this on yes causes that when you log out of desktop everything is killed

Indeed, which is breaking default people rely upon for no good reason. This is probably why distributions are compiling with --no-kill-user-process already because they too think this change is dumb.

0

u/totallyblasted May 29 '16 edited May 29 '16

It's very wanted and very intentional to be able to do that.

Is it also smart to do that? That is one can of worms I avoid like hell. There are so many better ways to do things properly, even background running tasks like this

You sure? Because I was pretty sure that this was some-how linked to the Martian takeover alliance with the Hilter zombie risen from the dead?

Our local newspaper spoke about Godzilla... Pffft, whom to believe

Indeed, which is breaking default people rely upon for no good reason.

One could also say that since some people tend to jump of bridges, railings are there just as useless obstruction that prevent those people from being more effective. Therefore, we should remove all railings from all the bridges

And running tasks like that is just the same, one could question either side. Validity of enforcing proper solutions to the problem or sanity of needing steps like this being taken in order to enforce policy. And as I see it, right now there is no telling which software needs special attention and this is solved by bad behaviour and leaving the problem to... nah, just leaving it. It is much more sane to simply enforce most strict policy on everyone and then expect that those needing special attention tell who and what they are as well as what they need. Kind of like firewall. First you close all, then you poke holes you need, other way around would be insanely insecure

I for one am for policy, you seem to be on the side that promotes bad behaviour should be supported if documented. As a developer I simply can't agree with bad design being prevalent over proper way

Update: This is more or less related to this

https://www.freedesktop.org/software/systemd/man/systemd-run.html#Examples

Especially note the ending of this page loginctl enable-linger. I think it is more proper that if you need this you take this extra step than all the people who don't need it be affected with bad behaviour just because you can't bring your self to do this simple requirement

5

u/Lennartwareparty May 29 '16

Is it also smart to do that? That is one can of worms I avoid like hell. There are so many better ways to do things properly, even background running tasks like this

Why is it a can of worms or bad idea?

Now people will just stay logged in, this is like saying you can only have a process running if it has a file descriptor open, the moment it closes its last file descriptor the process is killed. So people will just keep a file descriptor open to avoid that.

A login is nothing more than a conduit opened to a computer for human interaction which you close as a courtesy when you're done to free up resources for other users. To say that you can't have any processes running in between those conduits is as silly as saying all things in your house have to be cleaned out when you aren't home.

One could also say that since some people tend to jump of bridges, railings are there just as useless obstruction that prevent those people from being more effective. Therefore, we should remove all railings from all the bridges

Yeh, the difference being that very few people jump of bridges and people fall off them accidentally way more often while letting processes run when you aren't logged in is super common.

I for one am for policy, you seem to be on the side that promotes bad behaviour should be supported if documented. As a developer I simply can't agree with bad design being prevalent over proper way

you assume a-priori that it is "bad behaviour" there is nothing bad about letting processes run after you logged out.

This is like saying that if you work in a lab, you should destroy all your petri dishes in the lab when you're not in the lab going to the bathroom or home rather than letting it continue while you're at home. That's stupid. There is absolutely nothing objectionable about user processes continuing to run when the user is not logged in. A great many deal of processes require no interaction, log ins are for processes that require human interaction. And processes that do, id est those who connect to a graphical server or have a controlling terminal, are already told to exist upon logout.

0

u/totallyblasted May 29 '16

Why is it a can of worms or bad idea?

Because you can run things better and still in background. Just more politically correct

Main problem of enabling any bad behaviour for one REALLY, REALLY legit client is that you also get 1000 of unlegit ones who are just lazy. That is opening can of worms

Now people will just stay logged in

Maybe that was my bad since I only posted in update. Did you read the link I gave? This is exactly that, running things properly and only when requested.

Yeh, the difference being that very few people jump of bridges and people fall off them accidentally way more often while letting processes run when you aren't logged in is super common.

Same goes for people who run back tasks properly, there are far less of those who take shortcut.

you assume a-priori that it is "bad behaviour" there is nothing bad about letting processes run after you logged out

Nope. Just how you left them can be bad or good. If normal way also allows same behaviour when you didn't request it, yes... I consider this terrible.

Also, you seem to be greatly mistaken what I speak against. It is not background running processes (user or system), it is the way they are allowed to be uncontrolled

4

u/Lennartwareparty May 29 '16

Because you can run things better and still in background. Just more politically correct

Main problem of enabling any bad behaviour for one REALLY, REALLY legit client is that you also get 1000 of unlegit ones who are just lazy. That is opening can of worms

Again, what is bad about it? Why should processess belonging to a user be killed when that user logs out?

Where do you get this idea from that it's some-how sane or desirable behaviour to have only processes of logged in users running? Logins are a conduit for human interaction, to say you should only be running processes you interact with, because that's effectively what they are saying, is utterly silly.

Also, you seem to be greatly mistaken what I speak against. It is not background running processes (user or system), it is the way they are allowed to be uncontrolled

They are not allowed to be uncontrolled, the system administrator at any point is free to kill any processes ran by users who aren't logged in at the moment.

This mechanism already existed, when a controlling terminal a process is attached to dies it gets sent HUP, when a graphical session a program is connected to dies, it is notified of that and typically responds by killing itself. They basically replaced nohup with `systemd-run and called it good.

→ More replies