[systemd-devel] Support for pre-restart check

Lennart Poettering lennart at poettering.net
Wed Jul 30 05:09:03 PDT 2014

On Wed, 30.07.14 12:22, Ansgar Burchardt (ansgar at debian.org) wrote:

> Hi,
> while looking at how to convert sysvinit scripts to service files in
> Debian, I noticed that some scripts do an additional sanity check during
> the restart action. That is, they run an extra command to validate the
> configuration and only restart the service on success.
> Systemd doesn't seem to provide such an option so far. Would you think
> this is something one would like to see? If yes, what about the
> following idea:
> Add an ExecRestartPre option in the [Service] section. These commands
> are executed when a restart is requested, before the service is stopped.
> If they fail, the restart is aborted with an error.

This has been a TODO item since a long time. The usecase seems valid. So
far nobody found the time to implement this though. Happy to take patches...


Lennart Poettering, Red Hat

More information about the systemd-devel mailing list