Do not require portmap in netmount when nolock option is used with nfs mounts and fixup the test so that it actually works.

This commit is contained in:
Mike Frysinger 2007-09-25 02:29:56 +00:00
parent 450cc13a5c
commit f383365493
2 changed files with 22 additions and 15 deletions

View File

@ -1,6 +1,11 @@
# ChangeLog for Gentoo System Intialization ("rc") scripts # ChangeLog for Gentoo System Intialization ("rc") scripts
# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPLv2 # 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>: 24 Sep 2007; Roy Marples <uberlord@gentoo.org>:
Fix pppd metric, #193574 thanks to Martin Väth. Fix pppd metric, #193574 thanks to Martin Väth.

View File

@ -4,30 +4,32 @@
description="Mounts network shares according to /etc/fstab." description="Mounts network shares according to /etc/fstab."
have_nfs() { need_portmap() {
local IFS=\n x= local mnt opts ret IFS="
"
set -- $(fstabinfo --fstype nfs,nfs4) set -- $(fstabinfo --fstype nfs,nfs4)
for x in "$@" ; do for mnt in "$@" ; do
! fstabinfo --options "${x}" | grep -q noauto && return 0 case ,$(fstabinfo --options "${mnt}"), in
*,noauto,*|*,nolock,*) ;;
*) return 0;;
esac
done done
return 1 return 1
} }
depend() { depend() {
local myneed= myuse= pmap="portmap" nfsmounts= x # Only have portmap as a dependency if there is a nfs mount in fstab that
[ -x /etc/init.d/rpcbind ] && pmap="rpcbind"
# Only have Portmap as a dependency if there is a nfs mount in fstab that
# is set to mount at boot # is set to mount at boot
if have_nfs ; then local pmap=""
myneed="${myneed} ${pmap}" if need_portmap ; then
else [ -x /etc/init.d/rpcbind ] \
myuse="${myuse} ${pmap}" && pmap="rpcbind" \
|| pmap="portmap"
fi fi
config /etc/fstab config /etc/fstab
need net ${myneed} need net ${pmap}
use afc-client amd autofs dns nfs nfsmount ${myuse} use afc-client amd autofs dns nfs nfsmount portmap rpcbind
} }
start() { start() {
@ -45,7 +47,7 @@ start() {
# Only try to mount NFS filesystems if portmap was started. # Only try to mount NFS filesystems if portmap was started.
# This is to fix "hang" problems for new users who do not # This is to fix "hang" problems for new users who do not
# add portmap to the default runlevel. # add portmap to the default runlevel.
if have_nfs && ! service_started "${pmap}" ; then if need_portmap && ! service_started "${pmap}" ; then
continue continue
fi fi
;; ;;