From a9a347fc65966265a30774d02e1d114623185b92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20B=C3=A4chler?= Date: Sun, 7 Jun 2009 16:11:46 +0200 Subject: Make the daemon shutdown in rc.single consistent with rc.shutdown, see #12978 --- rc.single | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'rc.single') diff --git a/rc.single b/rc.single index 61cbdc7..cc3abc8 100755 --- a/rc.single +++ b/rc.single @@ -9,16 +9,16 @@ if [ "$PREVLEVEL" = "3" -o "$PREVLEVEL" = "5" ]; then # Shutdown daemons let i=${#DAEMONS[@]} - while [[ i -gt 0 ]]; do - if [[ $(echo ${DAEMONS[$i]} | /bin/grep '^[^\!]' | /usr/bin/wc -l) -eq 1 ]]; then - /etc/rc.d/${DAEMONS[$i]#@} stop + 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 - # find any leftover daemons and shut them down + # find any leftover daemons and shut them down in reverse order if [ -d /var/run/daemons ]; then - for daemon in $(/bin/ls /var/run/daemons); do - /etc/rc.d/$daemon stop + for daemon in $(/bin/ls -1t /var/run/daemons); do + stop_daemon $daemon done fi fi -- cgit v1.2.3