aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2008-04-25 14:15:03 -0400
committerBill Nottingham <notting@redhat.com>2008-04-25 14:15:03 -0400
commit5ec2aa3a9080117be7705c6dc35f94f6099f3f10 (patch)
tree9f9c957f593dd86b8900ff2fdb8f4539579bd776
parent1de0b38f2b65479c6a5a4bf67b67d995cd7c7a89 (diff)
downloadinitscripts-5ec2aa3a9080117be7705c6dc35f94f6099f3f10.tar
initscripts-5ec2aa3a9080117be7705c6dc35f94f6099f3f10.tar.gz
initscripts-5ec2aa3a9080117be7705c6dc35f94f6099f3f10.tar.bz2
initscripts-5ec2aa3a9080117be7705c6dc35f94f6099f3f10.tar.xz
initscripts-5ec2aa3a9080117be7705c6dc35f94f6099f3f10.zip
Import from event-compat-sysv-0.3.9-12.fc9
- Go back to using /etc/inittab for default runlevel (reverts #432384) - Add respawn (and a limit) to prefdm (#440061)
-rw-r--r--event.d/prefdm6
-rw-r--r--event.d/rcS11
-rw-r--r--event.d/rcS-sulogin13
3 files changed, 11 insertions, 19 deletions
diff --git a/event.d/prefdm b/event.d/prefdm
index e53d18d8..7098bd76 100644
--- a/event.d/prefdm
+++ b/event.d/prefdm
@@ -7,6 +7,6 @@ start on stopped rc5
stop on runlevel [!5]
console output
-script
- exec /etc/X11/prefdm -nodaemon
-end script
+respawn
+respawn limit 10 120
+exec /etc/X11/prefdm -nodaemon
diff --git a/event.d/rcS b/event.d/rcS
index b361de1c..f040b1e6 100644
--- a/event.d/rcS
+++ b/event.d/rcS
@@ -15,15 +15,14 @@ script
/etc/rc.d/rc.sysinit
runlevel --reboot || true
- . /etc/sysconfig/init
- RL="3"
- [ "$GRAPHICAL" = "yes" ] && RL="5"
+ runlevel=$(/bin/awk -F ':' '/^id:/ { print $2 }' /etc/inittab)
+ [ -z "$runlevel" ] && runlevel="3"
for t in $(cat /proc/cmdline); do
case $t in
- -s|single|S) RL="S" ;;
- [1-9]) RL="$t" ;;
+ -s|single|S) runlevel="S" ;;
+ [1-9]) runlevel="$t" ;;
esac
done
- telinit $RL
+ telinit $runlevel
end script
diff --git a/event.d/rcS-sulogin b/event.d/rcS-sulogin
index ba5eea2e..5125fc41 100644
--- a/event.d/rcS-sulogin
+++ b/event.d/rcS-sulogin
@@ -12,14 +12,7 @@ script
runlevel --set S >/dev/null || true
/bin/bash
- if [ -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
+ runlevel=$(/bin/awk -F ':' '/^id:/ { print $2 }' /etc/inittab)
+ [ -z "$runlevel" ] && runlevel="3"
+ telinit $runlevel
end script