supervise-daemon: add a --respawn-limit option

Allow limiting the number of times supervise-daemon will attempt to respawn a
daemon once it has died to prevent infinite respawning. Also, set a
reasonable default limit (10 times in a 5 second period).

This is for issue #126.
This commit is contained in:
William Hubbs
2017-05-09 18:20:52 -05:00
parent 96c8ba2fb5
commit 3673040722
4 changed files with 63 additions and 1 deletions

View File

@@ -25,6 +25,7 @@ supervise_start()
eval supervise-daemon --start \
${chroot:+--chroot} $chroot \
${pidfile:+--pidfile} $pidfile \
${respawn_limit:+--respawn-limit} $respawn_limit \
${command_user+--user} $command_user \
$supervise_daemon_args \
$command \