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

4

u/webpigeon May 29 '16

What if I'm not the sysadmin and simply want the daemon call to behave as it always has?

Then you're going to have a bad time because it would appear that the issue is slightly more complex than the bug tracker initially looks like it is. It would appear that a change in dbus to permit processes to live past the session may be the ultimate cause for the change.

The Arch Linux maintainer of D-Bus has configured it to use the model where D-Bus session services are treated as per-user services. This means they are shared between multiple logins (if you log in once in X11, once in text mode and once via ssh, they all share the same evolution-calendar-factory), which means it would be inappropriate for them to be terminated at the end of the X11 login session. If you want them to be terminated when you have no more parallel login sessions, that's what KillUserProcesses=yes is there for.

source

the commit message and bug report also tell us that this change appears to be the new way in which most distros have configured dbus to operate.

dbus daemon can now be run in the user session (with --enable-user-session, added in 1.10.2), and most distributions opted to pick this configuration. In the normal case it makes a lot of sense to kill remaining processes. The exception is stuff like screen and tmux. But it's easy enough to work around, a simple example was added to the man page in previous commit. In the long run those services should integrate with the systemd users session on their own.

So this behaviour was already broken on your system before this change occurred - processes are not being killed correctly because the system doesn't know when it's safe to kill them.

I don't use systemd, so systemd's issues/settings isn't a problem for me unless programmers begin to assume that all user processes are killed on logout.

If you don't use systemd then this change doesn't apply to you - unless your using dbus in user session mode in which case it does (and your system is already broken because the processes are assuming that they terminate on logout before this systemd change).

The issue is that the problem of unintended zombie or NOHUP'd processes that aren't cleaned up should be fixed where it is

I agree, but as I stated above not all developers fix their code and if you are not the admin you don't have the ability to remove the misbehaving packages - A system which behaves more consistently and predictably is a good thing in my eyes.

That also doesn't help with the fact that the dbus behaviour change appears to be an attempt to deal with the disparity between how processes which use dbus and don't use dbus operate.

How do you clean up a NOHUP'd process if it's deliberately choosing to stick around after session termination? When can you kill it? never? a weeks time? when all that user's sessions have terminated?

but clearly this attempt to fix broken behaviour and submit a bug report to clean up the resulting mess is some kind of evil systemd/dbus conspiracy to make you not have broken components in your session.

1

u/redrumsir May 29 '16

So this behaviour was already broken on your system before this change occurred - processes are not being killed correctly because the system doesn't know when it's safe to kill them.

It's not the init system's problem. It's the problem of the programs that initiated the process to handle signals appropriate to kill the process. In this case, the long-standing-convention is: "last one out of the door turns out the lights." IMO it's a symptom of dbus being a shitty protocol and encouraging this bad behavior. If you've got dbus and GNOME running on FreeBSD, for example ... you've got bugs and they should be fixed rather than assuming "big brother systemd" is going to cover up for the problem. Shitty design is not an excuse for crapping on other peoples stuff.