[systemd-devel] Allow stop jobs to be killed during shutdown

Lennart Poettering lennart at poettering.net
Wed Feb 5 00:10:51 CET 2014

On Wed, 29.01.14 19:29, Andrey Borzenkov (arvidjaar at gmail.com) wrote:

> > Thanks for tracking this done, this really sounds like you nailed the
> > problem. Now, how to fix it?
> > 
> > Hmm, so, I would claim this is a shortcoming of
> > KillMode=control-group, which is the default for everything. There has
> > been an item on the TODO list to maybe introduce a KillMode=mixed
> > setting, which would send SIGTERM only to the main process, and the
> > SIGKILL later on to all processes. I am pretty sure that this would
> > solve the issue at hand quite nicely here, because the systemd user
> > instance would get a nice chance to clean up its own act, before the
> > systemd system instance would make tabula rasa...
> > 
> I still favor alternative approach - let systemd wait for main PID
> to exit after ExecStop instead. This is functionally equivalent to the
> above with slight advantages

I am really not convinced that ExecStop= should be allowed to be
asynchronous. (Which is what you suggest we do, right?) In fact, it's
already problem enough that we pretend we allow ExecReload= to be
asynchronous like that... It's a question of allowing bad code
through... Either people let us shutdown a service, or they do it
themselves, but allowing a crappy (asynchronous) shutdown routine sounds
wrong to me...

At the hackfest in BRU I have now implemented KillMode=mixed, which
should fixed the issue mostly... Could you test, please?


Lennart Poettering, Red Hat

More information about the systemd-devel mailing list