/etc/event.d/rcS does not set RUNLEVEL properly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
upstart (Ubuntu) |
Fix Released
|
Low
|
Scott James Remnant (Canonical) |
Bug Description
Binary package hint: upstart-compat-sysv
Steps to reproduce:
1. put a script in /etc/init.d/foo and symlink it to /etc/rcS.d/S99foo
2. in said script, execute runlevel > /tmp/foo.log
To fix this bug all you need is:
--- /etc/event.d/rcS 2006-09-13 18:47:27.000000000 -0400
+++ rcS 2006-12-18 13:12:42.000000000 -0500
@@ -14,6 +14,12 @@
# information (we enter rc1 not rcS for maintenance). Run /etc/init.d/rc
# without information so that it defaults to previous=N runlevel=S.
script
- runlevel --set S >/dev/null || true
+ set $(runlevel --set S || true)
+ if [ "$1" != "unknown" ]; then
+ PREVLEVEL=$1
+ RUNLEVEL=$2
+ export PREVLEVEL RUNLEVEL
+ fi
+
exec /etc/init.d/rcS
end script
Related branches
Changed in upstart: | |
importance: | Undecided → Low |
status: | Unconfirmed → Confirmed |
It can't set it this way since /var/run isn't mounted at this point, so we're pretty likely to have a bogus "previous" runlevel in there.