Skip to content

Commit b28c249

Browse files
N-R-Knavi-desu
authored andcommitted
supervise-daemon: set default respawn-period to 12sec
currently respawn-period defaults to 0, which means if that a services crashes 10 times (default respawn-max) in a period of 1 year, then supervise-daemon will just stop it completely. which is very terrible default to say the least. set it to 12sec by default instead. with the current default respawn-delay of 0 and respawn-delay-step of 128ms it'd take roughly ~6 seconds if a service instantly crashes 10 times (current default respawn-max) in a row.
1 parent 8e3637e commit b28c249

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

man/supervise-daemon.8

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ Modifies the OOM score adjustment of the daemon.
153153
.It Fl P , -respawn-period Ar duration
154154
Sets the duration of a respawn period. See the
155155
description of --respawn-max and --respawn-delay for more information.
156+
Default is 12sec.
156157
.It Fl -respawn-delay-step Ar duration
157158
Increase the respawn-delay by duration with every retry within respawn-period.
158159
Default is 128ms.

src/supervise-daemon/supervise-daemon.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,10 @@ static int tty_fd = -1;
182182
#endif
183183
static pid_t child_pid;
184184
static int respawn_count = 0;
185-
static int64_t respawn_delay;
185+
static int64_t respawn_delay; /* default set inside main() */
186186
static int64_t respawn_delay_step = TM_MS(128);
187187
static int64_t respawn_delay_cap = TM_SEC(30);
188-
static int64_t respawn_period;
188+
static int64_t respawn_period; /* default set inside main() */
189189
static int respawn_max = 10;
190190
static char *fifopath = NULL;
191191
static int fifo_fd = 0;
@@ -831,7 +831,7 @@ int main(int argc, char **argv)
831831
char *str = NULL;
832832
char *cmdline = NULL;
833833
const char *respawn_delay_str = "0";
834-
const char *respawn_period_str = "0";
834+
const char *respawn_period_str = "12sec";
835835

836836
applet = basename_c(argv[0]);
837837
atexit(cleanup);

0 commit comments

Comments
 (0)