We have a fairly complex systemd service with Type=notify
. Very occasionally, the service will hang on startup/restart, and enter the failed
state after systemd failes to receive a sd_notify
call. We would like to restart the service in these cases - chances are, the second time it will start correctly.
However, the systemd.service(5) manual page says:
When the death of the process is a result of systemd operation (e.g. service stop or restart), the service will not be restarted.
Is there a way to overcome this restriction in the systemd configuration? Otherwise we will have to monitor the daemon status and manually restart it everytime it's stuck, or develop some kind of supervisor script for this, which may introduce more failure points into the system.