summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-03-15 05:43:49 +0000
committerMike Frysinger <vapier@gentoo.org>2005-03-15 05:43:49 +0000
commit2c783c5644b6cc1844520883de40c535424b77c7 (patch)
treee6ec6d54920bc72f3e75dd74d57934f45dbb9c78 /net-fs/nfs-utils/files/nfs
parentrev bump. more USE flag checks to ebuild. depend on working ffmpeg (diff)
downloadgentoo-2-2c783c5644b6cc1844520883de40c535424b77c7.tar.gz
gentoo-2-2c783c5644b6cc1844520883de40c535424b77c7.tar.bz2
gentoo-2-2c783c5644b6cc1844520883de40c535424b77c7.zip
Add support for integrated idmapd #71607 by Keith M Wesolowski.
(Portage version: 2.0.51.19)
Diffstat (limited to 'net-fs/nfs-utils/files/nfs')
-rwxr-xr-xnet-fs/nfs-utils/files/nfs50
1 files changed, 41 insertions, 9 deletions
diff --git a/net-fs/nfs-utils/files/nfs b/net-fs/nfs-utils/files/nfs
index 566fcea761b9..489eaec9d7bf 100755
--- a/net-fs/nfs-utils/files/nfs
+++ b/net-fs/nfs-utils/files/nfs
@@ -1,7 +1,7 @@
#!/sbin/runscript
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-fs/nfs-utils/files/nfs,v 1.9 2005/03/15 05:23:38 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-fs/nfs-utils/files/nfs,v 1.10 2005/03/15 05:43:49 vapier Exp $
#---------------------------------------------------------------------------
# This script starts/stops the following
@@ -17,26 +17,56 @@ opts="reload"
# This variable is used for controlling whether or not to run exportfs -ua;
# see stop() for more information
-restarting=yes
+restarting=no
# The binary locations
exportfs=/usr/sbin/exportfs
statd=/sbin/rpc.statd
+idmapd=/usr/sbin/rpc.idmapd
rquotad=/usr/sbin/rpc.rquotad
nfsd=/usr/sbin/rpc.nfsd
mountd=/usr/sbin/rpc.mountd
depend() {
- use ypbind
+ use ypbind net
+ need portmap
+ after quota
+}
+
+start_idmapd() {
+ [[ ! -x ${idmapd} ]] && return 0
- local myneed="net portmap"
- if [ -x /sbin/idmapd ] ; then
- if grep -q rpc_pipefs /proc/filesystems &>/dev/null; then
- myneed="${myneed} idmapd"
+ if grep -q rpc_pipefs /proc/filesystems ; then
+ if ! grep -q "rpc_pipefs /var/lib/nfs/rpc_pipefs" /proc/mounts ; then
+ [[ ! -d /var/lib/nfs/rpc_pipefs ]] && mkdir -p /var/lib/nfs/rpc_pipefs
+ ebegin "Mounting RPC pipefs"
+ mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs
+ eend $?
fi
fi
- need ${myneed}
- after quota
+
+ ebegin "Starting idmapd"
+ ${idmapd} ${RPCIDMAPDOPTS}
+ eend $?
+}
+
+stop_idmapd() {
+ [[ ! -x ${idmapd} ]] && return 0
+
+ ebegin "Stopping idmapd"
+ start-stop-daemon --stop --quiet --exec ${idmapd}
+ ret=$?
+ eend ${ret}
+
+ if [[ $restarting == "no" ]] ; then
+ if grep -q "rpc_pipefs /var/lib/nfs/rpc_pipefs" /proc/mounts ; then
+ ebegin "Unmounting RPC pipefs"
+ umount /var/lib/nfs/rpc_pipefs
+ eend $?
+ fi
+ fi
+
+ return ${ret}
}
start_statd() {
@@ -81,6 +111,7 @@ start() {
fi
# now that nfsd is mounted inside /proc, we can safely start mountd later
+ start_idmapd
start_statd
# Exportfs likes to hang if networking isn't working.
@@ -157,6 +188,7 @@ stop() {
fi
stop_statd
+ stop_idmapd
}
reload() {