[systemd-devel] Support for pre-restart check

Reindl Harald h.reindl at thelounge.net
Wed Jul 30 03:29:32 PDT 2014


Am 30.07.2014 12:22, schrieb Ansgar Burchardt:
> 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

as sysadmin i say: oh yes, that would be cool!

the first canmdidate would be Apache httpd
ExecRestartPre=/usr/sbin/apachectl -t

that would cat cases where you hard restart httpd after
library updates and some other guy made a typo in a config
or is still woking on it

"apachectl graceful" in such cases refuses the restart

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 246 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20140730/1a8da624/attachment.sig>


More information about the systemd-devel mailing list