3 # rpcidmapd Start up and shut down RPC name to UID/GID mapper
5 # Authors: Chuck Lever <cel@netapp.com>
8 # description: Starts user-level daemon for NFSv4 that maps user \
9 # names to UID and GID numbers.
11 # Source function library.
12 . /etc/rc.d/init.d/functions
15 . /etc/sysconfig/network
17 # Check that networking is up.
18 if is_yes "${NETWORKING}"; then
19 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
20 msg_network_down "RPC svcgssd"
27 if [ -x /sbin/pidof ] && [ "$1" != "stop" ]; then
28 [ -z "`/sbin/pidof portmap`" ] && nls "Error: portmap isn't running" && exit 0
32 [ -f /etc/sysconfig/nfsfs ] && . /etc/sysconfig/nfsfs
33 [ -f /etc/sysconfig/nfsd ] && . /etc/sysconfig/nfsd
35 # /usr may be on NFS, fail silently, nfsfs will start it
36 [ -x /usr/sbin/rpc.idmapd ] || exit 0
38 # Find out what the current runlevel dir is
39 RUNLEVELDIR=$(cat /var/run/runlevel.dir)
42 # Check if the service is already running?
43 if [ ! -f /var/lock/subsys/idmapd ]; then
44 # This is whacko, but we need /proc/fs/nfsd mounted before
45 # starting idmapd on NFS server
46 if [ -e "$RUNLEVELDIR"/S*nfs ]; then
47 if ! grep -q nfsd /proc/mounts ; then
48 modprobe -s nfsd > /dev/null 2>&1
49 run_cmd "Mounting /proc/fs/nfsd filesystem" mount -t nfsd nfsd /proc/fs/nfsd
52 if ! grep -q rpc_pipefs /proc/mounts ; then
53 modprobe -s sunrpc >/dev/null 2>&1
54 run_cmd "Mounting /var/lib/nfs/rpc_pipefs filesystem" \
55 mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs
58 msg_starting "RPC idmapd"
59 daemon rpc.idmapd $RPCIDMAPOPTIONS
61 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/idmapd
63 msg_already_running "RPC idmapd"
68 if [ -f /var/lock/subsys/idmapd ]; then
69 msg_stopping "RPC idmapd"
71 rm -f /var/lock/subsys/idmapd
73 msg_not_running "RPC idmapd"
77 # See how we were called.
95 if [ -f /var/lock/subsys/idmapd ]; then
96 msg_reloading "RPC idmapd"
97 killproc rpc.idmapd -HUP
100 msg_not_running "RPC idmapd" >&2
105 msg_usage "$0 {start|stop|restart|reload|status}"