aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2011-01-04 11:37:07 -0500
committerBill Nottingham <notting@redhat.com>2011-01-04 11:38:19 -0500
commit6831dcb405dc3b76cc38ced167b2bc6c54149e7d (patch)
treeabfdb9552f03aa061be6dea9b189f62af33cbaa2
parent72ef04dd98074d91adaf46a59f113d4c4a2beb77 (diff)
downloadinitscripts-6831dcb405dc3b76cc38ced167b2bc6c54149e7d.tar
initscripts-6831dcb405dc3b76cc38ced167b2bc6c54149e7d.tar.gz
initscripts-6831dcb405dc3b76cc38ced167b2bc6c54149e7d.tar.bz2
initscripts-6831dcb405dc3b76cc38ced167b2bc6c54149e7d.tar.xz
initscripts-6831dcb405dc3b76cc38ced167b2bc6c54149e7d.zip
Rework to handle bind-mounted cifs/ncpfs (#663140, <dmudrich@nospam.mudrichsystems.com>)
-rwxr-xr-xrc.d/init.d/netfs16
1 files changed, 12 insertions, 4 deletions
diff --git a/rc.d/init.d/netfs b/rc.d/init.d/netfs
index 501a8cb0..8d9854fb 100755
--- a/rc.d/init.d/netfs
+++ b/rc.d/init.d/netfs
@@ -25,8 +25,8 @@ NCPFSTAB=$(LC_ALL=C awk '!/^#/ && $3 == "ncpfs" && $4 !~ /noauto/ { print $2 }'
NETDEVFSTAB=$(LC_ALL=C awk '!/^#/ && $4 ~/_netdev/ && $4 !~ /noauto/ { print $1 }' /etc/fstab)
NFSMTAB=$(LC_ALL=C awk '$3 ~ /^nfs/ && $3 != "nfsd" && $2 != "/" { print $2 }' /proc/mounts)
-CIFSMTAB=$(LC_ALL=C awk '$3 == "cifs" { print $2 }' /proc/mounts)
-NCPMTAB=$(LC_ALL=C awk '$3 == "ncpfs" { print $2 }' /proc/mounts)
+CIFSMTAB=$(LC_ALL=C awk '$3 == "cifs" { print $2 }' /proc/mounts | tac)
+NCPMTAB=$(LC_ALL=C awk '$3 == "ncpfs" { print $2 }' /proc/mounts | tac)
NETDEVMTAB=$(LC_ALL=C awk '$4 ~ /_netdev/ && $2 != "/" { print $2 }' /etc/mtab)
# See how we were called.
@@ -117,8 +117,16 @@ case "$1" in
$"Unmounting NFS filesystems (retry): " \
"-f -l"
fi
- [ -n "$CIFSMTAB" ] && action $"Unmounting CIFS filesystems: " umount -a -t cifs
- [ -n "$NCPMTAB" ] && action $"Unmounting NCP filesystems: " umount -a -t ncp,ncpfs
+ if [ -n "$CIFSMTAB" ]; then
+ for MNT in $CIFSMTAB; do
+ action $"Unmounting CIFS filesystem: $MNT" umount "$MNT"
+ done
+ fi
+ if [ -n "$NCPMTAB" ]; then
+ for MNT in $NCPMTAB; do
+ action $"Unmounting NCP filesystem: $MNT" umount "$MNT"
+ done
+ fi
rm -f /var/lock/subsys/netfs
;;
status)