[systemd-devel] Conditional clean up action

Mircea Husz mirceahusz at yahoo.com
Thu Jan 4 20:50:39 UTC 2018


Migrating an init script to systemd, and need to archive logs only if the service exited normally with a return code 0. I foundĀ $SERVICE_RESULT, $EXIT_CODE, and $EXIT_STATUSĀ  but they are in a newer version of systemd, I am stuck with version 219 on CentOS 7.
I'd love to run ExecStopPost on a conditional exit status but that's just not available. Before I get creative with Pre, Start, and Post bash scripts, is there any straightforward way of handling this kind of thing with systemd ?
-Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20180104/4b35bc02/attachment.html>


More information about the systemd-devel mailing list