aboutsummaryrefslogtreecommitdiff
path: root/rc.single
diff options
context:
space:
mode:
authorThomas Bächler <thomas@archlinux.org>2009-06-07 16:11:46 +0200
committerThomas Bächler <thomas@archlinux.org>2009-06-07 16:11:46 +0200
commita9a347fc65966265a30774d02e1d114623185b92 (patch)
tree11906b742cd64c8d279054506552722c90b6299e /rc.single
parent2577e2d04044253add5df0bf8dc3af01a7609c24 (diff)
downloadinitscripts-a9a347fc65966265a30774d02e1d114623185b92.tar.xz
Make the daemon shutdown in rc.single consistent with rc.shutdown, see #12978
Diffstat (limited to 'rc.single')
-rwxr-xr-xrc.single12
1 files changed, 6 insertions, 6 deletions
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