[systemd-devel] ExecRestart

Lennart Poettering lennart at poettering.net
Wed Dec 19 14:46:13 PST 2012


On Wed, 28.11.12 22:41, Brandon Black (blblack at gmail.com) wrote:

> The daemon's "fast restart" code does all of the expensive startup
> operations in the new daemon first (e.g. parsing large data input), then
> signals the existing daemon to shut itself down, waits for it to release
> its critical resources (e.g. sockets, pidfile), and finally takes over
> those resources and finishes starting itself.  Basically it's using the
> overlap to avoid long service downtimes during that initial parsing phase
> (and if that parsing fails, it leaves the old daemon running to boot).

We specifically don't allow ExecRestart= in order to guarantee that all
restarts are comprehensive and really do what is necessary to be
done. For example, we consider it a good thing to kill all processes
forked off a daemon when we restart the daemon. We can do this easily
with the information from the cgroup, and we generally believe that such
a killing spree is best done from outside the daemon in question rather
from the suicidal daemon itself.

That said I do acknowledge that there is a bit of value of supporting
daemons which can do reexec on their own, where "reexec" is something
between the superficial "reload" and the hardcore "restart". In fact I
am kinda interested to implement "reexec" in some of systemd's own
services (such as journald), so that open sockets are kept around.

Now, the reason why we have no support for a nice "reexec" verb yet is
simply because I am a bit afraid of adding something that might turn-out
not to be necessary, and that might just be a special case of "reload"
after all. I mean, the difference between retsart and reload is kinda
complex already, and adding a third verb (plus all the various
transitive products of this such as "try-restart", "reload-or-restart"
for reexec) makes me feel a bit uncomfortable.

Or in other words:

I am pretty sure that we should not alter the current restart logic, and
should not introduce ExecRestart=. However, we really should think about
either introducing ExecReexec= or somehow making ExecReload= useful for
reexec-style reloading, too. But I haven't made my mind up on this, how
this could look like.

Michal, Zbigniew, Kay, do you have ideas about this?

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list