I want Upstart to do two things:
- stop trying to respawn a failed process so fast
- never give up trying to respawn
In an ideal world, upstart would try to restart a dead process after 1s, then double that delay on each attempt, until it reached an hour.
Is something like this possible?
Best Answer
The Upstart Cookbook recommends a post-stop delay (http://upstart.ubuntu.com/cookbook/#delay-respawn-of-a-job). Use the
respawn
stanza without arguments and it will continue trying forever:(I got this from this Ask Ubuntu question)
To add the exponential delay part, I'd try working with an environment variable in the post-stop script, I think something like:
** EDIT **
To apply the delay only when respawning, avoiding the delay on a real stop, use the following, which checks whether the current goal is "stop" or not: