I want my systemd service to be automatically restarted on failure. Additionally I want to rate limit the restarts. I want to allow maximum of 3 restarts within 90 seconds duration. Hence I have done the following configuration.
[Service]
Restart=always
StartLimitInterval=90
StartLimitBurst=3
Now the service is restarted on failure. After 3 Quick failures/restarts it is not restarting anymore as expected. Now I expected the systemd to start the service after the timeout (StartLimitInterval
). But the systemd is not automatically starting the service after the timeout(90sec), if I manually restart the service after the timeout it is working. But I want the systemd to automatically start the service after the StartLimitInterval
. Please let me know on how to achieve this feature.
StartLimitIntervalSec
, notStartLimitInterval
.StartLimitIntervalSec
was added in systemd v230 and should replaceStartLimitInterval
.StartLimitIntervalSec
was renamed toDefaultStartLimitIntervalUSec
in v237. But for you also even earlier change: move oldStartLimitInterval
from[Service]
to[Unit]
section inv229
as @Ingo described.StartLimitIntervalUSec
Unit directive inman systemd.directives(7)
,man systemd.unit(5)
mentions onlyStartLimitIntervalSec
.