Red Hat Bugzilla – Bug 855240
Upstart gives up respawning; want it to try forever
Last modified: 2015-10-13 07:09:27 EDT
Description of problem:
The previous /sbin/init would retry a failed respawn job forever; it would stop for five minutes, then continue; upstart offers no such facility.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Set up a task that should respawn, even if it fails
2. upstart has no "respawn forever" option
3. temporary network problem causes a vital process to completely fail
Respawn has a hard limit that results in the job stopping after exceeding that limit
respawn should provide an option to keep trying with some kind of rate limiting
This is a major problem for us, as upstart has unexpectedly abandoned various vital jobs; we now need to create monitoring for this, whereas with the previous inittab respawn, this was not necessary.
Easiest solution would be setting 'respawn limit' to more tolerant value.
(In reply to comment #2)
> Easiest solution would be setting 'respawn limit' to more tolerant value.
What we need is 'forever'. Setting it to a finite value is not a solution.
There is a patch in the launchpad bug referenced.
We are probably not planning to update upstart in next release, but you can also create second job which will be launched when the main job fails and stops respawning, and watch for network to go online again.
start on startup or mycheck FILE=exists
while [ -e /tmp/aaa ]; do sleep 1; done
start on stopped job
echo "File disappeared"
while [ ! -e /tmp/aaa ]; do sleep 10; done
echo "File appeared"
initctl emit mycheck FILE=exists
I want "respawn forever" option too.
Say, an unprivileged user is operating on console login. He used nested shells
(bash -> bash -> bash), and he finished his job. He pressed Ctrl-D for three
seconds so that all the nested shells are exited and he can completely log out
and the login prompt will appear. What will he get?
He gets a login prompt which no longer responds (because the mingetty process
is no longer respawned, like /var/log/messages says "init: tty (/dev/ttyX)
respawning too fast, stopped"). He can never login again from that tty. ;-(
(If he is malicious, he can kill all console ttys so that nobody can login from
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.
Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.
The original patch was never accepted upstream.