summaryrefslogtreecommitdiff
path: root/rc.shutdown
diff options
context:
space:
mode:
authorTobias Powalowski <tpowa@archlinux.org>2007-10-18 08:43:28 +0000
committerTobias Powalowski <tpowa@archlinux.org>2007-10-18 08:43:28 +0000
commitfa4866f0adce9c3e0bfc09fb878eebb99797c338 (patch)
treed881077369a0c811db6c8250972572b3ba01cec4 /rc.shutdown
parent8649f79e8e0027bd46da8b13f6d8ac5465471c35 (diff)
'upgpkg: trying to fix #6237,7554,7165,7641,5740'
Diffstat (limited to 'rc.shutdown')
-rwxr-xr-xrc.shutdown8
1 files changed, 4 insertions, 4 deletions
diff --git a/rc.shutdown b/rc.shutdown
index a6f8145..12b8f17 100755
--- a/rc.shutdown
+++ b/rc.shutdown
@@ -26,14 +26,14 @@ if [ "$PREVLEVEL" = "3" -o "$PREVLEVEL" = "5" ]; then
# Shutdown daemons
let i=${#DAEMONS[@]}
while [[ i -ge 0 ]]; do
- if [[ `echo ${DAEMONS[$i]} | grep '^[^\!]' | wc -l` -eq 1 ]]; then
- /etc/rc.d/${DAEMONS[$i]#@} stop
+ if [[ $(echo ${DAEMONS[$i]} | grep '^[^\!]' | wc -l) -eq 1 ]]; then
+ [ -f /var/run/daemons/${DAEMONS[$i]#@} ] && /etc/rc.d/${DAEMONS[$i]#@} stop
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 `ls /var/run/daemons`; do
+ for daemon in $(ls -1t /var/run/daemons); do
/etc/rc.d/$daemon stop
done
fi