From ae9e1c75a5e24e4f2c9d60eb4b8838e0b043ec7d Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Fri, 25 Apr 2008 14:11:19 -0400 Subject: Import from event-compat-sysv-0.3.9-8.fc9 --- event.d/rc-default | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 event.d/rc-default (limited to 'event.d/rc-default') diff --git a/event.d/rc-default b/event.d/rc-default new file mode 100644 index 00000000..9160062b --- /dev/null +++ b/event.d/rc-default @@ -0,0 +1,22 @@ +# rc - runlevel compatibility +# +# This task guesses what the "default runlevel" should be and starts the +# appropriate script. + +start on stopped rcS + +script + runlevel --reboot || true + + RL="2" + if [ -r /etc/inittab ]; then + RL="$(sed -n -e "/^id:[0-9]*:initdefault:/{s/^id://;s/:.*//;p}" /etc/inittab || true)" + fi + for t in $(cat /proc/cmdline); do + case $t in + -s|single|S) RL="S" ;; + [1-9]) RL="$t" ;; + esac + done + telinit $RL +end script -- cgit v1.2.1