aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/init.d/netfs
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2001-07-24 21:08:00 +0000
committerBill Nottingham <notting@redhat.com>2001-07-24 21:08:00 +0000
commit68196b57a6a37f786043129e39eb00852e8ad14e (patch)
treeb9c4f925c84d399bd83db886796cd1c3de03a871 /rc.d/init.d/netfs
parent2604a03f2105ed34bdd08817ee91bb653a478bf0 (diff)
downloadinitscripts-68196b57a6a37f786043129e39eb00852e8ad14e.tar
initscripts-68196b57a6a37f786043129e39eb00852e8ad14e.tar.gz
initscripts-68196b57a6a37f786043129e39eb00852e8ad14e.tar.bz2
initscripts-68196b57a6a37f786043129e39eb00852e8ad14e.tar.xz
initscripts-68196b57a6a37f786043129e39eb00852e8ad14e.zip
fix netdev umount stuff
Diffstat (limited to 'rc.d/init.d/netfs')
-rwxr-xr-xrc.d/init.d/netfs21
1 files changed, 20 insertions, 1 deletions
diff --git a/rc.d/init.d/netfs b/rc.d/init.d/netfs
index ba5a0eb1..4ffed775 100755
--- a/rc.d/init.d/netfs
+++ b/rc.d/init.d/netfs
@@ -25,6 +25,7 @@ fi
NFSFSTAB=`grep -v '^#' /etc/fstab | awk '{ if ($3 ~ /^nfs$/ && $4 !~ /noauto/) print $2}'`
SMBFSTAB=`grep -v '^#' /etc/fstab | awk '{ if ($3 ~ /^smbfs$/ && $4 !~ /noauto/) print $2}'`
NCPFSTAB=`grep -v '^#' /etc/fstab | awk '{ if ($3 ~ /^ncpfs$/ && $4 !~ /noauto/) print $2}'`
+NETDEVMTAB=`grep -v '^#' /proc/mounts | awk '{ if (($4 ~ /_netdev$/) && ($2 != "/")) print $2}'`
NFSMTAB=`grep -v '^#' /proc/mounts | awk '{ if (($3 ~ /nfs$/) && ($2 != "/")) print $2}'`
SMBMTAB=`grep -v '^#' /proc/mounts | awk '{ if ($3 ~ /^smbfs$/ ) print $2}'`
NCPMTAB=`grep -v '^#' /proc/mounts | awk '{ if ($3 ~ /^ncpfs$/ ) print $2}'`
@@ -63,7 +64,25 @@ case "$1" in
sig=-9
done
}
- action $"Unmounting network block filesystems: " umount -a -O netdev
+ [ -n "$NETDEVMTAB" ] && {
+ sig=
+ retry=3
+ while [ -n "$remaining" -a "$retry" -gt 0 ]
+ do
+ if [ "$retry" -lt 3 ]; then
+ action $"Unmounting network block filesystems (retry): " umount -a -O _netdev
+ else
+ action $"Unmounting network block filesystems: " umount -a -O _netdev
+ fi
+ sleep 2
+ remaining=`awk '!/^#/ && $4 ~ /_netdev/ && $2 != "/" {print $2}' /proc/mounts`
+ [ -z "$remaining" ] && break
+ /sbin/fuser -k -m $sig $remaining >/dev/null
+ sleep 5
+ retry=$(($retry - 1))
+ sig=-9
+ done
+ }
[ -n "$NFSMTAB" ] && {
sig=
retry=3