aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2001-07-31 18:38:19 +0000
committerBill Nottingham <notting@redhat.com>2001-07-31 18:38:19 +0000
commitff07811cdbf81debc386a5ab2e471d323b1a2207 (patch)
treef36b8c181e844d354b63e456cb715d119066b109
parentb25bdb6a7bb616485fbd8f577484c3b5c8b35c25 (diff)
downloadinitscripts-ff07811cdbf81debc386a5ab2e471d323b1a2207.tar
initscripts-ff07811cdbf81debc386a5ab2e471d323b1a2207.tar.gz
initscripts-ff07811cdbf81debc386a5ab2e471d323b1a2207.tar.bz2
initscripts-ff07811cdbf81debc386a5ab2e471d323b1a2207.tar.xz
initscripts-ff07811cdbf81debc386a5ab2e471d323b1a2207.zip
more FS umounting cleanups (<sopwith@redhat.com>)
-rwxr-xr-xrc.d/init.d/halt18
1 files changed, 11 insertions, 7 deletions
diff --git a/rc.d/init.d/halt b/rc.d/init.d/halt
index e5550469..30622249 100755
--- a/rc.d/init.d/halt
+++ b/rc.d/init.d/halt
@@ -144,33 +144,37 @@ remaining=`awk '!/^#/ && $1 ~ /^\/dev\/loop/ && $2 != "/" {print $2}' /proc/moun
sig=
retry=3
-remaining=`awk '!/(^#|proc|loopfs|autofs|^none|^\/dev\/root| \/ )/ {print $2}' /proc/mounts`
+remaining=`halt_get_remaining`
+halt_get_remaining() {
+ awk '!/(^#|proc|loopfs|autofs|^none|^\/dev\/root| \/ )/ {print $2}' /proc/mounts
+ awk '{ if ($3 ~ /^proc$/ && $2 !~ /^\/proc/) print $2; }' /proc/mounts
+}
while [ -n "$remaining" -a "$retry" -gt 0 ]
do
if [ "$retry" -lt 3 ]; then
- LANG=C runcmd $"Unmounting file systems (retry): " umount -a -f -t noproc
+ LANG=C runcmd $"Unmounting file systems (retry): " umount -f $remaining
else
- LANG=C runcmd $"Unmounting file systems: " umount -a -f -t noproc
+ LANG=C runcmd $"Unmounting file systems: " umount -f $remaining
fi
sleep 2
- remaining=`awk '!/(^#|proc|loopfs|autofs|^none|^\/dev\/root| \/ )/ {print $2}' /proc/mounts`
+ remaining=`halt_get_remaining`
[ -z "$remaining" ] && break
/sbin/fuser -k -m $sig $remaining >/dev/null
sleep 5
retry=$(($retry-1))
sig=-9
done
-
[ -f /proc/bus/usb/devices ] && umount /proc/bus/usb
+# Try them all, one last time.
+umount -a -f
+
# Remount read only anything that's left mounted.
#echo $"Remounting remaining filesystems (if any) readonly"
mount | awk '/( \/ |^\/dev\/root)/ { print $3 }' | while read line; do
mount -n -o ro,remount $line
done
-runcmd $"Unmounting proc file system: " umount /proc
-
# Now halt or reboot.
echo $"$message"
if [ -f /fastboot ]; then