aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>1999-09-20 17:45:35 +0000
committerBill Nottingham <notting@redhat.com>1999-09-20 17:45:35 +0000
commite8848932dcda96a91e27d6a9428c0fd89ab54272 (patch)
tree9b2dc149e12d06e2ce98f2fd278f0e2f73764e11
parent3249347f84eead7b7a498893f7c591955e3a5393 (diff)
downloadinitscripts-e8848932dcda96a91e27d6a9428c0fd89ab54272.tar
initscripts-e8848932dcda96a91e27d6a9428c0fd89ab54272.tar.gz
initscripts-e8848932dcda96a91e27d6a9428c0fd89ab54272.tar.bz2
initscripts-e8848932dcda96a91e27d6a9428c0fd89ab54272.tar.xz
initscripts-e8848932dcda96a91e27d6a9428c0fd89ab54272.zip
do process splatting for final umount too.
-rwxr-xr-xrc.d/init.d/halt24
1 files changed, 22 insertions, 2 deletions
diff --git a/rc.d/init.d/halt b/rc.d/init.d/halt
index a08b9283..6bfe6f99 100755
--- a/rc.d/init.d/halt
+++ b/rc.d/init.d/halt
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
#
# rc.halt This file is executed by init when it goes into runlevel
# 0 (halt) or runlevel 6 (reboot). It kills all processes,
@@ -63,7 +63,27 @@ OTHERSWAP=`awk '! /^Filename/ { print $1 }' /proc/swaps`
[ -n "$OTHERSWAP" ] && swapoff $OTHERSWAP
[ -x /sbin/accton ] && /sbin/accton
-runcmd "Unmounting file systems" umount -a -f
+
+# Unmount file systems, killing processes if we have to.
+sig=
+retry=3
+remaining=`awk `!/(^#|proc|^none|^\/dev\/root)/ {print $2}' /proc/mounts`
+while [ -n "$remaining" -a "$retry" -gt 0 ]
+do
+ if [ "$retry" -lt 3 ]; then
+ runcmd "Unmounting file systems" umount -a -f -t noproc
+ else
+ runcmd "Unmounting file systems" umount -a -f -t noproc
+ fi
+ sleep 2
+ remaining=`awk `!/(^#|proc|^none|^\/dev\/root)/ {print $2}' /proc/mounts`
+ [ -z "$remaining" ] && break
+ /sbin/fuser -k -m $sig $remaining >/dev/null
+ sleep 5
+ retry=$(($retry-1))
+ sig=-9
+done
+runcmd "Unmounting proc file system" umount /proc
mount -n -o remount,ro /
# turn off raid