diff options
-rwxr-xr-x | rc.single | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -7,7 +7,15 @@ . /etc/rc.d/functions if [ "$PREVLEVEL" = "3" -o "$PREVLEVEL" = "5" ]; then - # Shutdown daemons + # 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 @@ -15,12 +23,6 @@ if [ "$PREVLEVEL" = "3" -o "$PREVLEVEL" = "5" ]; then fi let i=i-1 done - # find any leftover daemons and shut them down in reverse order - if [ -d /var/run/daemons ]; then - for daemon in $(/bin/ls -1t /var/run/daemons); do - stop_daemon $daemon - done - fi fi if [ "$PREVLEVEL" != "N" ]; then |