[systemd-devel] [PATCH] Avoid reloading services when shutting down

Michael Biebl mbiebl at gmail.com
Tue Feb 3 13:22:04 PST 2015


2015-02-03 22:10 GMT+01:00 Lennart Poettering <lennart at poettering.net>:
> I don't see how this would apply to non-sysv code. I mean, code that
> is written with systemd semantics in mind should be able to issue a
> service reload during any time it wants to, if it keeps the ordering
> issues in mind. For example, if I have a service that has
> DefaultDependencies=no (and hence ordered against nothing at all by
> default), and I want to issue systemctl reload on it, knowing that
> this cannot really deadlock, since there are no deps that could cause
> deadlocks, then i should be able to do so. With your patch you turn
> these reloads into NOPs...

During shutdown (and early boot), yes. But why would you want to
schedule a restart or reload during shutdown?
Do you have a real-world example for that?

The thing is, you have to be extra careful to never, ever call a
restart/reload from such hook scripts. If those are triggered via
service or systemctl on a native or SysV script doesn't make a
difference.
It's simply to easy to cause a dead lock this way, and I think systemd
should try much harder to avoid such situations.


-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?


More information about the systemd-devel mailing list