[systemd-devel] Performing a config check before restarting a process

Terry Burton tez at terryburton.co.uk
Mon May 16 16:43:29 UTC 2016


On 13 May 2016 at 00:04, Terry Burton <tez at terryburton.co.uk> wrote:
> 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.

A quick nudge before moving along...


More information about the systemd-devel mailing list