aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Griffin <aaronmgriffin@gmail.com>2009-10-05 10:55:55 -0700
committerAaron Griffin <aaronmgriffin@gmail.com>2009-10-05 10:55:55 -0700
commit35a0950d0bc08061e6a27837ec26d4dace04993f (patch)
tree5150e9e5f5aed3c3a447a07dc1a0d7c7111d1ca4
parentacac4f47597320f55995bdaf692d6f2335a1d67e (diff)
downloadinitscripts-35a0950d0bc08061e6a27837ec26d4dace04993f.tar.xz
Always shutdown daemons, regardless of runlevel
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
-rwxr-xr-xrc.shutdown28
1 files changed, 13 insertions, 15 deletions
diff --git a/rc.shutdown b/rc.shutdown
index 34442ca..623146e 100755
--- a/rc.shutdown
+++ b/rc.shutdown
@@ -24,24 +24,22 @@ if [ -x /etc/rc.local.shutdown ]; then
/etc/rc.local.shutdown
fi
-if [ "$PREVLEVEL" = "3" -o "$PREVLEVEL" = "5" ]; then
- # Find daemons NOT in the DAEMONS array. Shut these down first
- if [ -d /var/run/daemons ]; then
- for daemon in $(/bin/ls -1t /var/run/daemons); do
- if ! in_array $daemon ${DAEMONS[@]}; then
- stop_daemon $daemon
- fi
- done
- fi
- # Shutdown daemons in reverse order
- let i=${#DAEMONS[@]}-1
- while [ $i -ge 0 ]; do
- if [ "${DAEMONS[$i]:0:1}" != '!' ]; then
- ck_daemon ${DAEMONS[$i]#@} || stop_daemon ${DAEMONS[$i]#@}
+# Find daemons NOT in the DAEMONS array. Shut these down first
+if [ -d /var/run/daemons ]; then
+ for daemon in $(/bin/ls -1t /var/run/daemons); do
+ if ! in_array $daemon ${DAEMONS[@]}; then
+ stop_daemon $daemon
fi
- let i=i-1
done
fi
+# Shutdown daemons in reverse order
+let i=${#DAEMONS[@]}-1
+while [ $i -ge 0 ]; do
+ if [ "${DAEMONS[$i]:0:1}" != '!' ]; then
+ ck_daemon ${DAEMONS[$i]#@} || stop_daemon ${DAEMONS[$i]#@}
+ fi
+ let i=i-1
+done
run_hook shutdown_prekillall