Systemd execute command after start limit reached

From the systemd.unit man page:

OnFailure=

A space-separated list of one or more units that are activated when this unit enters the "failed" state. A service unit using Restart= enters the failed state only after the start limits are reached.

However the second sentence appears to be a new constraint, as it is in the manual for version 241 of systemd on my Arch installations, but not in version 219 on my CentOS 7 installation.

You can check your systemd version with systemctl --version

I know it's an old question but just wanted to share for anyone else who has the same problem.


Startlimitaction may be what you want. The man page says

... Takes one of none, reboot, reboot-force, reboot-immediate, poweroff, poweroff-force or poweroff-immediate. If none is set, hitting the rate limit will trigger no action besides that the start will not be permitted.

It seems that setting startlimit action to none may do what you want.

Tags:

Systemd