]> git.pld-linux.org Git - packages/nfs-utils.git/commitdiff
- fix unmount:
authorJan Rękorajski <baggins@pld-linux.org>
Tue, 25 Sep 2007 15:57:59 +0000 (15:57 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- don't force and all
- skip / and /usr (rc.shutdown will do it for us)

Changed files:
    nfsfs.init -> 1.39

nfsfs.init

index d25609165c518bcd27d5fbe5cf9890f593f6441b..29e936c78726ee7ca8dc0cd304361881d82edf6d 100644 (file)
@@ -72,13 +72,20 @@ stop() {
        show "Unmounting NFS filesystems"
        busy
        retry=3
-       remaining=$(awk '$3 ~ /^nfs(4$|$)/ {print $2}' $fsfile)
+       remaining=$(awk '$3 ~ /^nfs(4$|$)/ && $2 !~ /^\/(usr$|$)/ {print $2}' $fsfile)
        while [ -n "$remaining" -a $retry -gt 0 ]; do
-               fuser -msk -TERM `awk '$3 ~ /^nfs(4$|$)/ {print $2}' < $fsfile`
+               fuser -msk -TERM `awk '$3 ~ /^nfs(4$|$)/ && $2 !~ /^\/(usr$|$)/ {print $2}' < $fsfile`
                sleep 2
-               fuser -msk -KILL `awk '$3 ~ /^nfs(4$|$)/ {print $2}' < $fsfile`
-               umount -a -f -t nfs,nfs4
-               remaining=$(awk '$3 ~ /^nfs(4$|$)/ {print $2}' $fsfile)
+               fuser -msk -KILL `awk '$3 ~ /^nfs(4$|$)/ && $2 !~ /^\/(usr$|$)/ {print $2}' < $fsfile`
+               # Sort filesystems to unmount in reverse order
+               rem=""
+               for r in $(awk '$3 ~ /^nfs(4$|$)/ && $2 !~ /^\/(usr$|$)/ {print $2}' $fsfile) ; do
+                       rem="$r $rem"
+               done
+               for fs in $rem ; do
+                       umount $fs
+               done
+               remaining=$(awk '$3 ~ /^nfs(4$|$)/ && $2 !~ /^\/(usr$|$)/ {print $2}' $fsfile)
                retry=$(($retry-1))
        done
        ok
This page took 0.08676 seconds and 4 git commands to generate.