mirror of
https://github.com/troglobit/finit.git
synced 2026-11-20 19:41:51 +00:00
service: add restart-max-sec, a limit for the restart back-off
The delay between restarts of a crashing service is fixed: two
seconds, then five, or restart-sec if that is longer. A service that
should be retried quickly at first and then less and less often, e.g.
a modem dialer, cannot be set up.
Add restart-max-sec, in the block format and as the restart-max-sec:
token:
service dialer {
restart = "always"
restart-sec = 10
restart-max-sec = 300
command = "dialer"
}
When set, the delay doubles for each restart, from restart-sec up to
the limit: 10, 20, 40, 80, 160, 300. Without restart-sec the first
restart is at once, then after 2, 4, 8 seconds. The delay follows the
restart counter, so it comes down again as the counter ages. With
restart always the counter stops where the delay peaks.
Fixes #306
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
8 files changed
+95
-8
No files matched your search
@@ -384,6 +384,15 @@ number of seconds before Finit tries to restart
|
||||
a crashing service, default: 2 seconds for the first five retries,
|
||||
then back-off to 5 seconds. The maximum of this configured value
|
||||
and the above (2 and 5) will be used
|
||||
.It Cm restart-max-sec:SEC
|
||||
replaces that back-off with a delay that doubles for each restart, from
|
||||
.Cm restart_sec
|
||||
up to this limit, e.g. 10, 20, 40, and so on up to 300 seconds with
|
||||
.Cm restart_sec:10 restart-max-sec:300 .
|
||||
Without
|
||||
.Cm restart_sec
|
||||
the first restart is at once, then after 2, 4, 8 seconds. The delay
|
||||
comes down again as the service keeps running
|
||||
.It Cm restart:always
|
||||
no upper limit on the number of times Finit tries to restart a crashing
|
||||
service. Same as
|
||||
|
||||
Reference in new issue
Block a user