[systemd-devel] after=user.slice not enforced

Lennart Poettering lennart at poettering.net
Tue Nov 22 16:20:09 UTC 2016


On Tue, 22.11.16 16:53, Cédric BRINER (cedric.briner at unige.ch) wrote:

> Hi,
> 
> sapRunning service contains a "After=user.slice". But at the shutdown, a
> process (write-sysv-test.pl) running in user.slice is killed before the
> end of the sapRunning's stop.

Slices are a concept for resource management, and that's what they
should be used for. Do not user them for anything else, such as
ordering purposes.

In systemd shutdown ordering is the inverse of start-up ordering, and
After= and Before= declare the latter. This means that if your service
has After=user.slice, this means at shutdown your service will be
stopped first and user.slice second.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list