Bug 855240 - Upstart gives up respawning; want it to try forever
Upstart gives up respawning; want it to try forever
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: upstart (Show other bugs)
x86_64 Linux
unspecified Severity medium
: rc
: ---
Assigned To: Lukáš Nykrýn
Depends On:
  Show dependency treegraph
Reported: 2012-09-07 00:45 EDT by Nick Urbanik
Modified: 2015-10-13 07:09 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-10-13 07:09:27 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Nick Urbanik 2012-09-07 00:45:01 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):

How reproducible:

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
Actual results:
Respawn has a hard limit that results in the job stopping after exceeding that limit

Expected results:
respawn should provide an option to keep trying with some kind of rate limiting

Additional info:
See https://bugs.launchpad.net/upstart/+bug/252997

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.
Comment 2 Lukáš Nykrýn 2012-09-07 04:35:46 EDT
Easiest solution would be setting 'respawn limit' to more tolerant value.
Comment 3 Nick Urbanik 2012-09-10 22:09:17 EDT
(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.
Comment 4 Lukáš Nykrýn 2012-09-17 07:16:15 EDT
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
end script

start on stopped job
	echo "File disappeared"
	while [ ! -e /tmp/aaa ]; do sleep 10; done
	echo "File appeared"
	initctl emit mycheck FILE=exists
end script
Comment 5 Tetsuo Handa 2013-07-01 08:16:20 EDT
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
Comment 6 RHEL Product and Program Management 2013-10-13 20:28:36 EDT
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.
Comment 7 Lukáš Nykrýn 2015-10-13 07:09:27 EDT
The original patch was never accepted upstream.

Note You need to log in before you can comment on or make changes to this bug.