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 daemon"
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
40 # See how we were called.
43 # Check if the service is already running?
44 if [ ! -f /var/lock/subsys/idmapd ]; then
45 if ! grep -q rpc_pipefs /proc/mounts ; then
46 modprobe -s sunrpc >/dev/null 2>&1
47 run_cmd "Mounting /var/lib/nfs/rpc_pipefs filesystem" \
48 mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs
51 msg_starting "RPC idmapd"
52 daemon rpc.idmapd $RPCIDMAPOPTIONS
54 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/idmapd
56 msg_already_running "RPC idmapd"
60 if [ -f /var/lock/subsys/idmapd ]; then
61 msg_stopping "RPC idmapd"
63 rm -f /var/lock/subsys/idmapd
65 msg_not_running "RPC idmapd"
78 msg_usage "$0 {start|stop|restart|status}"