[H-GEN] Systemd killing processes after logout
Russell Stuart
russell-humbug at stuart.id.au
Tue Jun 7 09:26:40 EDT 2016
On Tue, 2016-06-07 at 21:33 +1000, Clinton Roy wrote:
> In my mind, if you log out, all your processes should get killed.
> Things like tmux and screen that want to keep things hanging around
> should be required to go through an extra hoop, and a hoop that's
> configurable by the sysadmin.
They do already go through an extra hoop. They have to, otherwise they
would be killed at logout on every 'nix system since at least V6. The
problem isn't the hoop jumping jumping they are doing is being ignored
by this change.
> On a desktop system, I dare say that the default hoop (I think I just
> broke the analogy) should be for screen and tmux to `just work'.
I personally don't care if tmux et al don't work on a desktop system.
I can't recall ever using them there. The problem under this new
regime they are killed on a server system, eg where someone has
started a job using ansible. Note the immediate problem they are try
to solve (see the URL I sent previously) only effects the desktop.
> I..don't remember it that way, of course. I really like the idea of
> journalctl, being able to quickly and easily search for a timestamp
> or a unit, or a particular error string in all your system logs is a
> great idea. Unfortunately the implementation has been subpar in my
> experience
Ignoring the corruption bug which I presume will be fixed one day, I
have several problems with it.
Firstly, stuff that was written to stderr when you start a service (eg,
I can't parse my config file so I refuse to start), is no longer
written to stderr. So it takes an extra step to see it.
Secondly, although it certainly looks like it should be quick and easy
to search the logs using journalctl's command line options, for me at
least it isn't - the old faithful zgrep is still faster. When you add
viewing the logs in an editor to the mix, it's a slam down misère. Of
course there was no need to make us choose, we could have had both if
they had just written out normal text files and added an index - but
they felt the need to completely expunge the old way.
And finally, why in gods name did they choose to default to truncating
the log lines? The default output of journalctl is so bad I've
considered writing a front end that displays what I actually asked it
to display - in the order it happened.
The really sad bit is it could have been an improvement. The idea of
capturing the stdout and stderr of services and writing it to a log
file makes everyone's life easier. Indexing the text logs would speed
up searches, and if the indexes were corrupted they are easy enough to
rebuild (unlike the current binary mess). Sealing the logs, which was
introduced by journalctl was a much needed improvement. But no, they
could not stop there - they had to re-invent the bits of the wheel that
were working well.
> I think here's where I disagree, asking processes to die on logout
> just isn't the right thing to do. Telling them they're going to die,
> then killing them, is, imo.
Depends on what your goal is I guess. SIGHUP means "He's logged out"
and SIGTERM means "He wants you to exit". It's a distinction that has
worked well for 30 years, and every program understands it. They
changed from SIGHUP to SIGTERM so the distinction is gone. WTF?
The second change is more understandable. I can understand somebody
wanting to send a SIGKILL if the SIGHUP wasn't enough encouragement.
Unfortunately the circumstances are not "all the bloody time, breaking
backward compatibility". Every time I've seen someone say they need
this, it's for unwashed untrusted GUI users who have started something
in the background, then because of the two trees thing it keep running
on logout. That isn't the fault of these newbies of course, is the
fault of the systemd / gnome geniuses who introduced a design bug. The
bug aside adding a feature, perhaps triggered by PAM (because it can
tell what sort of session you are in - ssh, gdm, telnet, etc) allowing
the box owners to kill everything sounds like a nice little addition.
But that's not what these idiots did.
More information about the General
mailing list