Add respawn limit to prevent infinite respawn.

The respawn count is not incremented until post-start exits, so we
need to set the count lower than the interval to allow for the lag
caused by the one second sleep. Two times in 5 seconds seems like
enough to handle the occasional unexpected crash but stay dead when
things are badly broken.

Change-Id: I8eaca6f9ea131861a42d473ffc5c09a41226ce0e
This commit is contained in:
Clint Byrum 2013-05-16 20:19:20 -07:00
parent 47ab02a616
commit 6d28d4c99c
1 changed files with 3 additions and 0 deletions

View File

@ -18,6 +18,9 @@ pre-start script
end script
respawn
# the default post-start of 1 second sleep delays respawning enough to
# not hit the default of 10 times in 5 seconds. Make it 2 times in 5s.
respawn limit 2 5
exec start-stop-daemon --start -c $user --exec /opt/stack/venvs/$user/bin/$cmd -- $args