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. – Marc Tamsky Oct 24 '17 at 17:10StartLimitIntervalSecwas added in systemd v230 and should replaceStartLimitInterval. – Roman Sklyarov Oct 16 '20 at 19:33StartLimitIntervalSecwas renamed toDefaultStartLimitIntervalUSecin v237. But for you also even earlier change: move oldStartLimitIntervalfrom[Service]to[Unit]section inv229as @Ingo described. – pevik Dec 04 '20 at 10:28StartLimitIntervalUSecUnit directive inman systemd.directives(7),man systemd.unit(5)mentions onlyStartLimitIntervalSec. – pevik Dec 04 '20 at 11:09