From 84750f5722e668423dbd33f20bb7325240f0b535 Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Tue, 7 Dec 2010 11:54:03 -0600 Subject: bug 232347: fix netmount to respect _netdev option The _netdev option in fstab on linux systems indicates that a filesystem should only be mounted if the network is available. This commit fixes netmount to support this. --- init.d/netmount.in | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/init.d/netmount.in b/init.d/netmount.in index 3af1ad6a..88ce16f0 100644 --- a/init.d/netmount.in +++ b/init.d/netmount.in @@ -43,7 +43,7 @@ start() local myneed= myuse= pmap="portmap" nfsmounts= [ -x @SYSCONFDIR@/init.d/rpcbind ] && pmap="rpcbind" - local x= fs= + local x= fs= rc= for x in $net_fs_list; do case "$x" in nfs|nfs4) @@ -65,7 +65,12 @@ start() ebegin "Mounting network filesystems" mount -at $fs - ewend $? "Could not mount all network filesystems" + rc=$? + if [ "$RC_UNAME" = Linux ]; then + mount -a -O _netdev + rc=$? + fi + ewend $rc "Could not mount all network filesystems" return 0 } @@ -93,5 +98,9 @@ stop() retval=$? eoutdent + if [ "$RC_UNAME" = Linux ]; then + umount -a -O _netdev + retval=$? + fi eend $retval "Failed to unmount network filesystems" } -- cgit v1.2.3