Joachim Wiberg 62bd5f4892 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>
2026-11-19 20:39:42 +01:00
2025-07-10 15:35:46 +02:00
2025-07-10 14:34:16 +02:00
2025-12-26 13:28:43 +01:00

License Badge Release Badge GitHub Status Coverity Status Finit: Fast Init

Finit is a fast, simple alternative to SysV init and systemd, designed for small and embedded Linux systems. It can also run on desktop and server systems, like finix.

Reverse engineered from the EeePC fastinit
"gaps filled with frog DNA …"
— Claudio Matsuoka

For detailed information, explore our extensive documentation
📚 http://finit-project.github.io

Alpine screenshot

For working examples, see the 🚀 contrib/ section or these tutorials:

Note

Finit can run on various Linux distributions, but the bundled install scripts are examples only. They have been tested on amd64 (x86_64) systems with standard configurations.

For embedded systems, see these Buildroot-based examples: myLinux, Infix, or br2-finit-demo.

Languages
C 83.8%
Shell 12.5%
Makefile 2%
M4 1.6%