Systemd service status if ExecStop or ExecStopPost fails?
+0
−0
Will the overall unit status be failed
if either ExecStop
or ExecStopPost
fail? I would expect it to be so, but the documentation isn't very explicit about it.
1 answer
+0
−0
Yes, the unit will enter the failed
state if either one of those failed.
You verify this with a test unit like this:
[Unit]
Description=ExecStop failure test
[Service]
ExecStart=echo I might just fail in a sec!
ExecStop=exit 1
ExecStopPost=exit 1
Documentation wise, apparently this excerpt in ExecStart
applies to all the Exec directives:
If one of the commands fails (and is not prefixed with "-"), other lines are not executed, and the unit is considered failed.
0 comment threads