aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2008-11-24 15:07:46 -0500
committerBill Nottingham <notting@redhat.com>2008-11-24 15:10:03 -0500
commiteab6a318a9182386cb585d1346dd5d7ed2ec1f8a (patch)
tree8424e45698bb5e4796abf5098dbdee748ac4dd5d
parent3b557715bdcd09e8347a5509d71f8822dab25643 (diff)
downloadinitscripts-eab6a318a9182386cb585d1346dd5d7ed2ec1f8a.tar
initscripts-eab6a318a9182386cb585d1346dd5d7ed2ec1f8a.tar.gz
initscripts-eab6a318a9182386cb585d1346dd5d7ed2ec1f8a.tar.bz2
initscripts-eab6a318a9182386cb585d1346dd5d7ed2ec1f8a.tar.xz
initscripts-eab6a318a9182386cb585d1346dd5d7ed2ec1f8a.zip
When looking for the default runlevel, don't match commented lines. (#472717)
-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 59a0b4d3..70cf67cc 100644
--- a/event.d/rcS-sulogin
+++ b/event.d/rcS-sulogin
@@ -14,7 +14,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