service: start restart always at two seconds between restarts

A crashing service with restart always waited five seconds before
every restart.  It should wait two seconds for the first five, like a
service with the default restart-max:

    service foo {
        restart = "always"
        command = "foo"
    }

The back-off starts after half of restart-max attempts.  For restart
always restart-max is -1, so half of it was zero and the back-off
began with the first restart.  Use the default restart-max instead.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2026-11-19 20:39:40 +01:00
1 parent 631baab756
commit 4e1b0d4fbe
5 files changed
+67 -5

No files matched your search

+2
View File
@@ -65,6 +65,7 @@ EXTRA_DIST += process-depends.sh
EXTRA_DIST += rclocal.sh
EXTRA_DIST += ready-serv.sh
EXTRA_DIST += remain-task-control.sh
EXTRA_DIST += restart-backoff.sh
EXTRA_DIST += restart-self.sh
EXTRA_DIST += runlevel.sh
EXTRA_DIST += run-restart-forever.sh
@@ -139,6 +140,7 @@ TESTS += process-depends.sh
TESTS += rclocal.sh
TESTS += ready-serv.sh
TESTS += remain-task-control.sh
TESTS += restart-backoff.sh
TESTS += restart-self.sh
TESTS += runlevel.sh
TESTS += sysvparts.sh