[systemd-devel] Q: ExecStartPost and SuccessExitStatus

Lennart Poettering lennart at poettering.net
Tue Jul 28 13:54:56 UTC 2020


On Di, 28.07.20 15:50, Ulrich Windl (Ulrich.Windl at rz.uni-regensburg.de) wrote:

> Hi!
>
> I have a case where my main process has two success exit codes, and
> I'd like to run the ExecStartPost only if the exit code was
> 0. However as I understand the documentation any exit code listed
> for SuccessExitStatus is considered successful. I also listed the
> alternative success return code in RestartPreventExitStatus, but
> that's probably not necessary.

> If I don't list the alternative exit code as success, the service
> will be flages as failed, I guess...
>
> How would you solve this problem?

Dou you actually men ExecStartPost=? Or is this a typo and you mean
ExecStopPost=?

How does your service definition look like otherwise?

You can query the exit code with "systemctl show -p ExecMainStatus --value <service>".

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list