aboutsummaryrefslogtreecommitdiffstats
path: root/event.d/rcS-sulogin
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2008-04-25 16:55:17 -0400
committerBill Nottingham <notting@redhat.com>2008-04-25 16:55:17 -0400
commitd78b58c6fb9110d78f8750b4d3779a401d2ebf92 (patch)
tree96d50eab0a42fb770d24cf6ca1883a13eca62ce7 /event.d/rcS-sulogin
parent89388cd39edcc42ae355ff854f14649822591263 (diff)
downloadinitscripts-d78b58c6fb9110d78f8750b4d3779a401d2ebf92.tar
initscripts-d78b58c6fb9110d78f8750b4d3779a401d2ebf92.tar.gz
initscripts-d78b58c6fb9110d78f8750b4d3779a401d2ebf92.tar.bz2
initscripts-d78b58c6fb9110d78f8750b4d3779a401d2ebf92.tar.xz
initscripts-d78b58c6fb9110d78f8750b4d3779a401d2ebf92.zip
Only run telinit for the default runlevel if we exit sanely (#444001, #444050)
Diffstat (limited to 'event.d/rcS-sulogin')
-rw-r--r--event.d/rcS-sulogin13
1 files changed, 9 insertions, 4 deletions
diff --git a/event.d/rcS-sulogin b/event.d/rcS-sulogin
index d74620db..c7866b93 100644
--- a/event.d/rcS-sulogin
+++ b/event.d/rcS-sulogin
@@ -10,10 +10,15 @@ stop on runlevel
console owner
script
runlevel --set S >/dev/null || true
- /bin/bash || true
+ exec /bin/bash
end script
post-stop script
- runlevel=$(/bin/awk -F ':' '$3 == "initdefault" { print $2 }' /etc/inittab)
- [ -z "$runlevel" ] && runlevel="3"
- exec telinit $runlevel
+ echo $* > /tmp/sulogin.$$
+ set >> /tmp/sulogin.$$
+ if [ "$1" = "S" ]; then
+ runlevel=$(/bin/awk -F ':' '$3 == "initdefault" { print $2 }' /etc/inittab)
+ [ -z "$runlevel" ] && runlevel="3"
+ exec telinit $runlevel
+ fi
end script
+