aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--event.d/rcS2
-rw-r--r--event.d/rcS-sulogin2
2 files changed, 2 insertions, 2 deletions
diff --git a/event.d/rcS b/event.d/rcS
index b01ddc57..e50e897f 100644
--- a/event.d/rcS
+++ b/event.d/rcS
@@ -18,7 +18,7 @@ script
end script
post-stop script
if [ "$UPSTART_EVENT" == "startup" ]; then
- runlevel=$(/bin/awk -F ':' '$3 == "initdefault" { print $2 }' /etc/inittab)
+ runlevel=$(/bin/awk -F ':' '$3 == "initdefault" && $1 !~ "^#" { print $2 }' /etc/inittab)
[ -z "$runlevel" ] && runlevel="3"
for t in $(cat /proc/cmdline); do
case $t in
diff --git a/event.d/rcS-sulogin b/event.d/rcS-sulogin
index 00c1d34c..d3aa20d1 100644
--- a/event.d/rcS-sulogin
+++ b/event.d/rcS-sulogin
@@ -15,7 +15,7 @@ script
end script
post-stop script
if [ "$1" = "S" ]; then
- runlevel=$(/bin/awk -F ':' '$3 == "initdefault" { print $2 }' /etc/inittab)
+ runlevel=$(/bin/awk -F ':' '$3 == "initdefault" && $1 !~ "^#" { print $2 }' /etc/inittab)
[ -z "$runlevel" ] && runlevel="3"
exec telinit $runlevel
fi