Bug#825394: systemd kill background processes after user logs out

Guus Sliepen guus at debian.org
Sun May 29 10:46:36 BST 2016


On Sun, May 29, 2016 at 11:13:32AM +0200, Martin Pitt wrote:

> I've long wanted to enable killing leftover processes on logout. In my
> world, that's what I actually expect when I log out of a computer, and
> I *don't* want anything running as my user any more (which in turn
> keeps my encrypted home dir unlocked too). I never got around to
> enabling the option, but the upstream change was a welcome nudge to
> actually enable this. I believe this *is* it the expected thing to do
> on personal computers.

Yes, I certainly expect things to be cleaned up properly as well. I am
also mildly annoyed by all these newfangled daemons that are running and
don't properly clean up themselves. But I don't want proper programs
that are supposed to keep running to be collateral damage.

> This is certainly different in environments
> like universities where one often does put long-running stuff in the
> background, but this doesn't appeal to me as being the behaviour to
> optimize for.  At the moment I'm not sure whether this bug report and
> the followups are just a vocal minority or somewhat representative of
> Debian's user (I lean towards the former).

I'm sure the majority of users couldn't care less either way. What we
have to think about is: does the minority of people who really want this
feature (for example, because you want your homedir to be locked
whenever possible) outweigh the minority of people who really don't
want this feature (because they lose time/work when their processes get
killed unexpectedly)?

> However, this really shouldn't be such a general problem: If/when we
> can change tmux and screen to use PAM or enable lingering, then I
> think we get the best of both worlds: Logging out would clean up
> properly, but the (relatively few) users who use screen/tmux on a PC
> would get the expected behaviour of those processes surviving.

Note that I did only give tmux and screen as examples, they are not the
only programs that might go into the background. As mentioned by John
Brooks, it would be even more confusing if some programs do work because
and others don't. 

> So I'm fine with reverting to the previous behaviour until a more
> fine-grained API (https://github.com/systemd/systemd/issues/3382) is
> available.

I wonder if there are other approaches than to have to shoe-horn every
legacy backgrounding process into systemd's view of the world. Maybe
instead of a "lingering" option, could there be a "non-lingering"
option, that gets applied to those processes that you expect to
disappear when you log out of a session? And why do these processes not
quit properly anyway?

How about only sending the HUP signal to processes that don't have a
pseudo-TTY assigned? That would kill all those daemons, leave anything
running inside a screen/tmux/terminal untouched?

-- 
Met vriendelijke groet / with kind regards,
      Guus Sliepen <guus at debian.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20160529/380e838d/attachment-0002.sig>


More information about the Pkg-systemd-maintainers mailing list