]> git.ipfire.org Git - thirdparty/systemd.git/commit
slice: system.slice should be perpetual like -.mount 8107/head
authorAlan Jenkins <alan.christopher.jenkins@gmail.com>
Sun, 4 Feb 2018 20:46:27 +0000 (20:46 +0000)
committerAlan Jenkins <alan.christopher.jenkins@gmail.com>
Sun, 4 Feb 2018 22:51:34 +0000 (22:51 +0000)
commitd8e5a9338278d6602a0c552f01f298771a384798
tree5cab4b27d3d020c4d937a0d585308ac44c4ba680
parent0c79456781ab649ef28c0343e4f42f0861d083ad
slice: system.slice should be perpetual like -.mount

`-.mount` is placed in `system.slice`, and hence depends on it.
`-.mount` is always active and can never be stopped.  Therefore the same
should be true of `system.slice`.

Synthesize it as perpetual (unless systemd is running as a user manager).
Notice we also drop `Before=slices.target` as unnecessary.

AFAICS the justification for `perpetual` is to provide extra protection
against unintentionally stopping every single service.  So adding
system.slice to the perpetual units is perfectly consistent.

I don't expect this will (or can) fix any other problem.  And the
`perpetual` protection probably isn't formal enough to spend much time
thinking about.  I've just noticed this a couple of times, as something
that looks strange.

Might be a bit surprising that we have user.slice on-disk but not
system.slice, but I think it's ok. `systemctl status system.slice` will
still point you towards `man systemd.special`.  The only detail is that the
system slice disables `DefaultDependencies`.  If you're worrying about how
system shutdown works when you read `man systemd.slice`, I think it is not
too hard to guess that system.slice might do this:

> Only slice units involved with early boot
> or late system shutdown should disable this option

(Docs are great. I really appreciate the systemd ones).
src/core/slice.c
units/meson.build
units/system.slice [deleted file]