summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2007-08-10 16:06:21 +0000
committerBill Nottingham <notting@redhat.com>2007-08-10 16:06:21 +0000
commite9ecfbbf6d0aa3ead9e7a64417215ca1d9daf296 (patch)
tree19cade76adb820a6d811987d143c50b16d702e7d
parent3f47da11e2587b048129ac7d0c71e9aa6f9c22ac (diff)
- netfs: sort nfs mounts for unmounting (#251657)
-rw-r--r--initscripts.spec2
-rwxr-xr-xrc.d/init.d/netfs4
2 files changed, 4 insertions, 2 deletions
diff --git a/initscripts.spec b/initscripts.spec
index 20a5f2dd..87a73373 100644
--- a/initscripts.spec
+++ b/initscripts.spec
@@ -207,6 +207,8 @@ rm -rf $RPM_BUILD_ROOT
%ghost %attr(0664,root,utmp) /var/run/utmp
%changelog
+- netfs: sort nfs mounts for unmounting (#251657)
+
* Thu Aug 02 2007 Harald Hoyer <harald@redhat.com> - 7.93.31.EL-1
- set the hwclock before udev starts (#230997)
diff --git a/rc.d/init.d/netfs b/rc.d/init.d/netfs
index 8609e813..a395fb77 100755
--- a/rc.d/init.d/netfs
+++ b/rc.d/init.d/netfs
@@ -144,7 +144,7 @@ case "$1" in
[ -n "$NFSMTAB" ] && {
sig=
retry=3
- remaining=`LC_ALL=C awk '!/^#/ && $3 ~ /^nfs/ && $2 != "/" {print $2}' /proc/mounts`
+ remaining=`LC_ALL=C awk '!/^#/ && $3 ~ /^nfs/ && $2 != "/" {print $2}' /proc/mounts | sort -r`
while [ -n "$remaining" -a "$retry" -gt 0 ]
do
if [ "$retry" -lt 3 ]; then
@@ -153,7 +153,7 @@ case "$1" in
action $"Unmounting NFS filesystems: " umount -f -l $remaining
fi
sleep 2
- remaining=`LC_ALL=C awk '!/^#/ && $3 ~ /^nfs/ && $2 != "/" {print $2}' /proc/mounts`
+ remaining=`LC_ALL=C awk '!/^#/ && $3 ~ /^nfs/ && $2 != "/" {print $2}' /proc/mounts | sort -r`
[ -z "$remaining" ] && break
/sbin/fuser -k -m $sig $remaining >/dev/null
sleep 5