mirror of
https://github.com/troglobit/finit.git
synced 2026-11-23 20:11:44 +00:00
service: stop the restart counter of restart always from overflowing
The restart counter is a char, and with restart always nothing stops it. A service restarted more often than the counter ages wrapped it after 127 restarts, 255 on Arm. initctl status then showed a negative count and the back-off fell back to two seconds. Make the counter an int that stops at INT_MAX. With restart always it stops at 10, the default restart-max. The back-off peaks at half of that, and from 10 the counter ages back within the hour. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
3 files changed
+20
-7
No files matched your search
@@ -179,7 +179,7 @@ typedef struct svc {
|
||||
int restart_tmo; /* Time before restarting a crashing service */
|
||||
unsigned char oncrash_action; /* Action to perform in crashed state. */
|
||||
char respawn; /* ttys, or services with `respawn`, never increment restart_cnt */
|
||||
const char restart_cnt; /* Incremented for each restart by service monitor. */
|
||||
const int restart_cnt; /* Incremented for each restart by service monitor. */
|
||||
|
||||
union {
|
||||
/* services we redirect stdout/stderr to syslog (not TTYs!) */
|
||||
|
||||
Reference in new issue
Block a user