From 3673040722b75c0a4d06fbeb272f917c7d1ea7c4 Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Tue, 9 May 2017 18:20:52 -0500 Subject: 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. --- man/openrc-run.8 | 6 ++++++ man/supervise-daemon.8 | 20 ++++++++++++++++++++ 2 files changed, 26 insertions(+) (limited to 'man') diff --git a/man/openrc-run.8 b/man/openrc-run.8 index 25ec5b91..c7ac2ac1 100644 --- a/man/openrc-run.8 +++ b/man/openrc-run.8 @@ -167,6 +167,12 @@ Display name used for the above defined command. Process name to match when signaling the daemon. .It Ar stopsig Signal to send when stopping the daemon. +.It Ar respawn_limit +Respawn limit +.Xr supervise-daemon 8 +will use for this daemon. See +.Xr supervise-daemon 8 +for more information about this setting. .It Ar retry Retry schedule to use when stopping the daemon. It can either be a timeout in seconds or multiple signal/timeout pairs (like SIGTERM/5). diff --git a/man/supervise-daemon.8 b/man/supervise-daemon.8 index 06087675..43e74ef7 100644 --- a/man/supervise-daemon.8 +++ b/man/supervise-daemon.8 @@ -34,6 +34,8 @@ .Ar user .Fl r , -chroot .Ar chrootpath +.Fl R , -respawn-limit +.Ar limit .Fl 1 , -stdout .Ar logfile .Fl 2 , -stderr @@ -99,6 +101,24 @@ Modifies the scheduling priority of the daemon. .It Fl r , -chroot Ar path chroot to this directory before starting the daemon. All other paths, such as the path to the daemon, chdir and pidfile, should be relative to the chroot. +.It Fl R , -respawn-limit Ar limit +Control how agressively +.Nm +will try to respawn a daemon when it fails to start. The limit argument +can be a pair of integers separated bya colon or the string unlimited. +.Pp +If a pair of integers is given, the first is a maximum number of respawn +attempts and the second is a time period. It should be interpreted as: +If the daemon dies and has to be respawned more than +times in any time period of seconds, exit and give up. +.Pp +For example, the default is 10:5. +This means if the supervisor respawns a daemon more than ten times +in any 5 second period, it gives up and exits. +.Pp +if unlimited is given as the limit, it means that the supervisor will +not exit or give up, no matter how many times the daemon it is +supervising needs to be respawned. .It Fl u , -user Ar user Start the daemon as the specified user. .It Fl 1 , -stdout Ar logfile -- cgit v1.2.3