diff options
author | Thomas Bächler <thomas@archlinux.org> | 2009-06-07 16:11:46 +0200 |
---|---|---|
committer | Thomas Bächler <thomas@archlinux.org> | 2009-06-07 16:11:46 +0200 |
commit | a9a347fc65966265a30774d02e1d114623185b92 (patch) | |
tree | 11906b742cd64c8d279054506552722c90b6299e /rc.single | |
parent | 2577e2d04044253add5df0bf8dc3af01a7609c24 (diff) |
Make the daemon shutdown in rc.single consistent with rc.shutdown, see #12978
Diffstat (limited to 'rc.single')
-rwxr-xr-x | rc.single | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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 |