[systemd-devel] Creating new targets to order shutdown

Andrei Borzenkov arvidjaar at gmail.com
Tue Jan 17 17:24:33 UTC 2017


17.01.2017 18:21, Ray Nichols пишет:
> Hello,
> 
> 
> 
> I'm interested in a particular scenario which has been mentioned on
> mailing lists before:
> 
> https://www.mail-archive.com/search?l=systemd-devel@lists.freedesktop.org&q=subject:%22%5C%5Bsystemd%5C-devel%5C%5D+after%3Duser.slice+not+enforced%22&o=newest&f=1
>
> 
> 
> 
> 
> 
> about stopping a database service. For the moment I'm considering the
> simplest case where systemd controls both the start and stopping of
> the service (though I'm mainly interested in the stop).
> 
> 
> 
> 
> 
> What I'm finding in testing is that I cannot find an approach that
> stops the service before its user processes get killed first.
> 
> 


User processes belong to scope units. Scope units are created
programmatically by logind and have predefined set of dependencies.
There is no hooks to change it from logind side; and because names are
not predictable (and do not use templates) it is not possible to use
drop ins. So there is really no way to order anything against user
sessions unless you patch logind source.


More information about the systemd-devel mailing list