From 35a0950d0bc08061e6a27837ec26d4dace04993f Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Mon, 5 Oct 2009 10:55:55 -0700 Subject: Always shutdown daemons, regardless of runlevel Signed-off-by: Aaron Griffin --- rc.shutdown | 28 +++++++++++++--------------- 1 file 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 -- cgit v1.2.3