[systemd-devel] Is restart gracefull?

David Timothy Strauss david at davidstrauss.net
Thu Nov 28 23:59:10 PST 2013


On Fri, Nov 29, 2013 at 12:53 PM, Lennart Poettering
<lennart at poettering.net> wrote:
> On Fri, 29.11.13 00:11, Cecil Westerhof (Cecil.Westerhof at Snow.nl) wrote:
>> I have done a trial presentation about systemd. One of the questions
>> there was: when a restart of for example apache is doen, is this
>> restart done graceful?
> For systemd a "restart" is actually exactly what the name says: a stop
> plus a start. "reload" otoh is up to the implementer of the unit file,
> whatever he chooses.

Just to clarify, "stop" (and, by extension "restart") is also up to
the implementer of the unit file. There just happens to be a default,
unlike with "reload." See the service and exec man pages for details.
Regardless, "restart" and "stop" usually both involve a full shutdown
of every process running the daemon. I think it's possible to override
this behavior with certain options, but you shouldn't.

If you want to explore much deeper, you may also be interested in
socket activation, which allows a server socket to remain open even
while a daemon is fully shut down (whether because it hasn't started
yet, is restarting, or has been stopped). It takes graceful
restarts/reloads up to the systemd level.


More information about the systemd-devel mailing list