runit event.d file should stop service in single user mode

Bug #315541 reported by Christian Hudon
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
runit (Ubuntu)
Fix Released
Undecided
Unassigned
Precise
Fix Released
Medium
Unassigned
Quantal
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: runit

[Impact]
Because runit uses an upstart stanza (stop on shutdown) which does not exist it will not be termineted when switching to single user mode and is just left running.

[Test Case]
1. Install runit and add the directory test to /etc/service.
3. Add a script called 'run' and a script called 'finish' to this directory. Add a line 'echo run > /test; sleep 10000' and 'echo finish > /test' to run and finish respectively, then make them executable.
4. When run is marked executable, runsvdir will start it, check with pstree -a to see the runsvdir process tree and run somewhere beneath. Observe that /test contains 'run'.
5. Execute the command 'sudo telinit 1' and wait for the single user command prompt.
6. Observe that pstree -a will still show runsvdir, runsv and run to be running. Also observe that /test will not contain 'finish', which means that runsv has never been told that runsvdir is going to terminate.

runit has not been restarted, it has never been terminated in the first place. It needs a correct upstart configuration to even try to terminate processes graceful. Furthermore, runsvdir expects SIGHUP to correctly shutdown all supervised services.

[Regression potential]
IMO small, unless someone came to rely on the broken behaviour.

Revision history for this message
Francis Russell (francis-russell) wrote :

I've added a debdiff that should fix this issue here:

https://bugs.launchpad.net/ubuntu/+source/runit/+bug/245728

It's against the runit source package in maverick. Can you confirm that the runsvdir process itself was still active in single user mode? The current package behaviour should have resulted in runsvdir being killed and not respawning, but the runsv processes and the services they were supervising still remaining alive. Any testing or feedback would be appreciated.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package runit - 2.1.1-6.2ubuntu3

---------------
runit (2.1.1-6.2ubuntu3) raring; urgency=low

  [ Christoph Mathys ]
  * Kill runsvdir with SIGHUP when entering runlevel [016]. Fixes LP: #245728,
    LP: #315541 & LP: #539567.

  [ Francis Russell ]
  * Remove installation of runsvdir.conf in obsolete location /etc/event.d.
  * Modify postinst script so that it doesn't to try to grep /etc/inittab on
    initial package install if it doesn't exist.
 -- Christoph Mathys <email address hidden> Fri, 07 Dec 2012 20:43:15 -0500

Changed in runit (Ubuntu):
status: New → Fix Released
Changed in runit (Ubuntu Precise):
status: New → Triaged
importance: Undecided → Medium
Changed in runit (Ubuntu Quantal):
status: New → Triaged
importance: Undecided → Medium
eraserix (eraserix)
description: updated
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Christian, or anyone else affected,

Accepted runit into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/runit/2.1.1-6.2ubuntu2.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in runit (Ubuntu Precise):
status: Triaged → Fix Committed
tags: added: verification-needed
Changed in runit (Ubuntu Quantal):
status: Triaged → Fix Committed
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello Christian, or anyone else affected,

Accepted runit into quantal-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/runit/2.1.1-6.2ubuntu2.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote : [runit/precise] verification still needed

The fix for this bug has been awaiting testing feedback in the -proposed repository for precise for more than 90 days. Please test this fix and update the bug appropriately with the results. In the event that the fix for this bug is still not verified 15 days from now, the package will be removed from the -proposed repository.

tags: added: removal-candidate
Revision history for this message
Christian Hudon (chrish) wrote :

Sorry if it took a while to test this. The server where this is installed doesn't have a screen usually, and ssh-ing in doesn't work very well to test stuff in single-user mode. I can now confirm that the fix works for me.

Revision history for this message
Brian Murray (brian-murray) wrote :

On which release of Ubuntu did you test this Christian? 12.04 or 12.10?

Revision history for this message
Christian Hudon (chrish) wrote :

On 12.04, as that's what I have on my server, and it stays on the LTS releases.

Steve Langasek (vorlon)
tags: added: verification-done-precise
Revision history for this message
Chris J Arges (arges) wrote :

I've been able to reproduce the issue. Installed the package in -proposed and it fixed the issue as described in the test case.

tags: added: verification-done-quantal
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package runit - 2.1.1-6.2ubuntu2.1

---------------
runit (2.1.1-6.2ubuntu2.1) precise; urgency=low

  [ Christoph Mathys ]
  * Kill runsvdir with SIGHUP when entering runlevel [016]. Fixes LP: #245728,
    LP: #315541 & LP: #539567.

  [ Francis Russell ]
  * Remove installation of runsvdir.conf in obsolete location /etc/event.d.
  * Modify postinst script so that it doesn't to try to grep /etc/inittab on
    initial package install if it doesn't exist.
 -- Christoph Mathys <email address hidden> Tue, 11 Sep 2012 13:14:37 +0200

Changed in runit (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for runit has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package runit - 2.1.1-6.2ubuntu2.2

---------------
runit (2.1.1-6.2ubuntu2.2) quantal; urgency=low

  [ Christoph Mathys ]
  * Kill runsvdir with SIGHUP when entering runlevel [016]. Fixes LP: #245728,
    LP: #315541 & LP: #539567.

  [ Francis Russell ]
  * Remove installation of runsvdir.conf in obsolete location /etc/event.d.
  * Modify postinst script so that it doesn't to try to grep /etc/inittab on
    initial package install if it doesn't exist.
 -- Christoph Mathys <email address hidden> Tue, 11 Sep 2012 13:14:37 +0200

Changed in runit (Ubuntu Quantal):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.