[systemd-devel] Performing a config check before restarting a process
Terry Burton
tez at terryburton.co.uk
Thu May 12 23:04:33 UTC 2016
Hi,
I have a process (ISC DHCP) that has no reload or soft restart
mechanism. The only way to "reload" it is a stop and start.
I understand systemd's design choice of maintaining a clear
distinction between reload and restart based on whether the service is
interrupted or not, so it's clear that I should use restart.
However, in the event that the user invokes "restart" I would like to
validate the config file before taking the Stop action to avoid loss
of service (as was the case for the reload action of my previous init
scripts.)
We do not however have ExecStopPre and there does not appear to be a
way to interrupt a Stop action based on the result of ExecStop so I'm
not sure where that leaves me? Does anyone have a useful recipe that
accomplishes this?
Perhaps such a config check is considered one of those things that
lives in a support script or user's best practises outside of the init
system... That seems a shame though.
Thanks,
Terry
More information about the systemd-devel
mailing list