aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hubbs <williamh@gentoo.org>2010-12-07 11:54:03 -0600
committerWilliam Hubbs <williamh@gentoo.org>2010-12-07 11:54:03 -0600
commit84750f5722e668423dbd33f20bb7325240f0b535 (patch)
treea30309f8dbca7122cd8b67eb0e1880f093e9ae27
parentf8f03bdbbff14db0c79dfe1eb907e14a27ce0e73 (diff)
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.
-rw-r--r--init.d/netmount.in13
1 files 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"
}