Comment 2 for bug 85014

Revision history for this message
Steven Shiau (stevenshiau) wrote : Re: Fail to enter rc1.d by putting 1 in bootparam in edgy

OK, my workaround is to modify /etc/event.d/rc-default, and make it like the following. It works for me. Thanks.
------
start on rcS/stop

script
        runlevel --reboot || true

        if grep -q -w -- "-s\|single\|S" /proc/cmdline; then
            telinit S
        elif grep -qE -w -- "[1-5]" /proc/cmdline; then
            RL="$(grep -Eo -w -- "[1-5]" /proc/cmdline)"
            if [ -n "$RL" ]; then
                telinit $RL
            else
                telinit 2
            fi
        elif [ -r /etc/inittab ]; then
            RL="$(sed -n -e "/^id:[0-9]*:initdefault:/{s/^id://;s/:.*//;p}" /etc
/inittab || true)"
            if [ -n "$RL" ]; then
                telinit $RL
            else
                telinit 2
            fi
        else
            telinit 2
        fi
end script
-------------