summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rwxr-xr-xinit.d/netmount32
2 files changed, 22 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index 2725130..92aaa48 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for Gentoo System Intialization ("rc") scripts
# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPLv2
+ 24 Sep 2007; Mike Frysinger <vapier@gentoo.org>:
+
+ Do not require portmap in netmount when nolock option is used with nfs
+ mounts and fixup the test so that it actually works.
+
24 Sep 2007; Roy Marples <uberlord@gentoo.org>:
Fix pppd metric, #193574 thanks to Martin Väth.
diff --git a/init.d/netmount b/init.d/netmount
index c0f3e9f..7ead6d9 100755
--- a/init.d/netmount
+++ b/init.d/netmount
@@ -4,30 +4,32 @@
description="Mounts network shares according to /etc/fstab."
-have_nfs() {
- local IFS=\n x=
+need_portmap() {
+ local mnt opts ret IFS="
+"
set -- $(fstabinfo --fstype nfs,nfs4)
- for x in "$@" ; do
- ! fstabinfo --options "${x}" | grep -q noauto && return 0
+ for mnt in "$@" ; do
+ case ,$(fstabinfo --options "${mnt}"), in
+ *,noauto,*|*,nolock,*) ;;
+ *) return 0;;
+ esac
done
return 1
}
depend() {
- local myneed= myuse= pmap="portmap" nfsmounts= x
- [ -x /etc/init.d/rpcbind ] && pmap="rpcbind"
-
- # Only have Portmap as a dependency if there is a nfs mount in fstab that
+ # Only have portmap as a dependency if there is a nfs mount in fstab that
# is set to mount at boot
- if have_nfs ; then
- myneed="${myneed} ${pmap}"
- else
- myuse="${myuse} ${pmap}"
+ local pmap=""
+ if need_portmap ; then
+ [ -x /etc/init.d/rpcbind ] \
+ && pmap="rpcbind" \
+ || pmap="portmap"
fi
config /etc/fstab
- need net ${myneed}
- use afc-client amd autofs dns nfs nfsmount ${myuse}
+ need net ${pmap}
+ use afc-client amd autofs dns nfs nfsmount portmap rpcbind
}
start() {
@@ -45,7 +47,7 @@ start() {
# Only try to mount NFS filesystems if portmap was started.
# This is to fix "hang" problems for new users who do not
# add portmap to the default runlevel.
- if have_nfs && ! service_started "${pmap}" ; then
+ if need_portmap && ! service_started "${pmap}" ; then
continue
fi
;;