My suggested fix is to add the following to the top of /etc/event.d/rc6
and /etc/event.d/rc0*
set $(runlevel || true)
if [ "$2" = "0" ] || [ "$2" = "6" ]; then
runlevel --set "$1" || true
fi
This means that if runlevel 0 or 6 are entered from either of those two
runlevels, the PREVIOUS runlevel is restored. This will have the
following behaviour:
- Ctrl-Alt-Del pressed
- runlevel = 2, prevlevel = N
- rc6 runs
- runlevel = 6, prevlevel = 2
- runs /etc/init.d/rc 6
- Ctrl-Alt-Del pressed
- rc6 runs again
- runlevel = 2, prevlevel = 6 (caused by the above script snippet)
- runlevel = 6, prevlevel = 2 (caused by the start of the remainder of the
script)
- runs /etc/init.d/rc 6
The result will be that whenever halt or reboot are run from within
runlevel 0 or runlevel 6, the entire /etc/rc0.d or /etc/rc6.d sequence
is run.
This should give correct behaviour from "halt within halt", "reboot
within reboot" AND "reboot within halt"
--
Ctl+Alt+Del twice at tty console login gives root access
https://launchpad.net/bugs/63852
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs