diff options
author | Aaron Griffin <aaronmgriffin@gmail.com> | 2009-10-05 10:55:55 -0700 |
---|---|---|
committer | Aaron Griffin <aaronmgriffin@gmail.com> | 2009-10-05 10:55:55 -0700 |
commit | 35a0950d0bc08061e6a27837ec26d4dace04993f (patch) | |
tree | 5150e9e5f5aed3c3a447a07dc1a0d7c7111d1ca4 /rc.shutdown | |
parent | acac4f47597320f55995bdaf692d6f2335a1d67e (diff) |
Always shutdown daemons, regardless of runlevel
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
Diffstat (limited to 'rc.shutdown')
-rwxr-xr-x | rc.shutdown | 28 |
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 |