RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 855240 - Upstart gives up respawning; want it to try forever
Summary: Upstart gives up respawning; want it to try forever
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: upstart
Version: 6.3
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Lukáš Nykrýn
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-09-07 04:45 UTC by Nick Urbanik
Modified: 2015-10-13 11:09 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-10-13 11:09:27 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Nick Urbanik 2012-09-07 04:45:01 UTC
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):
upstart-0.6.5-12.el6.x86_64

How reproducible:
Always

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 08:35:46 UTC
Easiest solution would be setting 'respawn limit' to more tolerant value.

Comment 3 Nick Urbanik 2012-09-11 02:09:17 UTC
(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 11:16:15 UTC
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.


::::::::::::::
job.conf
::::::::::::::
start on startup or mycheck FILE=exists
script
	while [ -e /tmp/aaa ]; do sleep 1; done
end script
respawn

::::::::::::::
test.conf
::::::::::::::
start on stopped job
script
	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 12:16:20 UTC
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
console.)

Comment 6 RHEL Program Management 2013-10-14 00:28:36 UTC
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 11:09:27 UTC
The original patch was never accepted upstream.


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