Comment 2 for bug 252997

Revision history for this message
Angus Salkeld (asalkeld) wrote : Re: respawn should try again after a while?

I am curious about what kind of process / daemon you would do this for.

My thinking is ...

For an important daemon:
-restart it X times within a certain time
-don't count "normal exits" so you can reload configuration.
-if it still fails within this time frame you really need to try something new.
 So we need to be able to catch this as an event in a recovery script.
 Currently I use "start on stopping my-daemon RESULT=failed".

For something like getty:
-respawn forever (no limit) I assume that this is the case you are talking about for the rate limiting.

Jeff) What is the delay going to help? Surely you would want to restart your application ASAP.

If you still need it can't you do something like this in your job?

start script
  if [ -e /var/run/my.pid ]
  then
    sleep 10
    rm -f /var/run/my.pid
  fi
  exec /usr/sbin/my-daemon
script