runit doesn't stop and /var isn't umounted on shutdown
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
runit (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Precise |
Fix Released
|
Medium
|
Unassigned | ||
Quantal |
Fix Released
|
Medium
|
Unassigned |
Bug Description
[Impact]
Runit does not properly terminate the services it supervises, it just leaves them running. This can lead to files being open during unmount and with that dirty filesystems on the next reboot.
A minor annoyance is that postinst prints errors during installation because it tries to grep an inexistent file.
[Test Case]
1. Install runit from a purged state (e.g. dpkg -P runit; apt-get install runit). Observe the errors from postinst: grep: /etc/inittab: No such file or directory
2. 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 'stop runsvdir', which will shutdown the runit service.
6. Observe that pstree -a will still show runsv to be running, only the parent runsvdir process has been terminated. Also observe that /test will not contain 'finish', which means that runsv has never been told that runsvdir is going to terminate.
runsvdir expects SIGHUP to correctly shutdown all supervised services. Upstart sends SIGTERM by default, which causes runsvdir to exit immediately without cleaning up supervised processes.
[Regression potential]
IMO small, unless someone came to rely on the broken behaviour.
Changed in runit: | |
importance: | Undecided → Medium |
tags: | added: patch |
Changed in runit (Ubuntu): | |
status: | New → Confirmed |
description: | updated |
Changed in runit (Ubuntu Quantal): | |
status: | New → Triaged |
importance: | Undecided → Medium |
Changed in runit (Ubuntu Precise): | |
status: | Confirmed → Triaged |
OS: Ubuntu Hardy Heron.