[systemd-devel] Support for pre-restart check

Reindl Harald h.reindl at thelounge.net
Wed Jul 30 21:48:29 PDT 2014


Am 31.07.2014 um 02:41 schrieb Michael Biebl:
> 2014-07-30 14:34 GMT+02:00 Reindl Harald <h.reindl at thelounge.net>:
>> "ExecStopPre" would be better suited as the pre-restart check because
>> it would achieve the goal and also prevent stop a service until it's
>> configuration is fixed - that catchs cases where you stop something
>> for whatever reason and expect it would be started at the next boot
> 
> I don't think that would be a wise thing to do.
> If I want to reboot my system, it shouldn't fail to reboot because of
> a buggy apache configuration

it could simply called and failing ignored in that case
systemd knows that the system is at sthut down

> Apache should shutdown and simply fail to start on next reboot

in that case yes

Am 31.07.2014 um 02:16 schrieb Colin Guthrie:> Reindl Harald wrote on 30/07/14 13:34:
>> *how* should that both help in calling "apachectl -t" *before* stop the
>> service and in case of a error-repsonse keep it running?
>
> Note, just for clarity, you don't really want to run such a config test
> when explicitly stopping a service

i do want that in case it ends in a state where i can't start it afterwards
"systemctl stop X && rsync data....; systemctl start X" and go to a coffee is
not that uncommon

> that should always succeed IMO (unless you think that "systemctl
> kill ..." should be used in such circumstances?)

i think so

> I really think an ExecRestartPre (or perhaps a more explicit
> ExecRestartCheck) would be a more sensible name (ExecStopPre implies it
> would run when explicitly stopping which, as noted above, I think is a
> bad plan). It wouldn't run when an ExecReload is given explicitly but if
> that operation falls back to restart, it would.

falls back?
how?

when i say "systemctl reload" nothing has to trigger a hard restart
and even if - in case of a broken config



-------------- 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/20140731/7b6738fb/attachment.sig>


More information about the systemd-devel mailing list