3 # idmapd Start up and shut down RPC name to UID/GID mapper
6 # description: Starts user-level daemon for NFSv4 that maps user \
7 # names to UID and GID numbers.
9 # Source function library.
10 . /etc/rc.d/init.d/functions
13 . /etc/sysconfig/network
15 # Check that networking is up.
16 if is_yes "${NETWORKING}"; then
17 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
18 msg_network_down "RPC idmapd"
25 if [ "$1" != "stop" ]; then
26 check_portmapper || { nls "Error: portmap isn't running" && exit 0; }
30 [ -f /etc/sysconfig/nfsfs ] && . /etc/sysconfig/nfsfs
31 [ -f /etc/sysconfig/nfsd ] && . /etc/sysconfig/nfsd
33 # /usr may be on NFS, fail silently, nfsfs will start it
34 [ -x /usr/sbin/rpc.idmapd ] || exit 0
36 # Find out what the current runlevel dir is
37 RUNLEVELDIR=$(cat /var/run/runlevel.dir)
40 # Check if the service is already running?
41 if [ ! -f /var/lock/subsys/idmapd ]; then
42 # This is whacko, but we need /proc/fs/nfsd mounted before
43 # starting idmapd on NFS server
44 if [ -e "$RUNLEVELDIR"/S*nfs ]; then
45 if ! grep -q nfsd /proc/mounts ; then
46 modprobe nfsd > /dev/null 2>&1
47 run_cmd "Mounting /proc/fs/nfsd filesystem" mount -t nfsd nfsd /proc/fs/nfsd
50 if ! grep -q rpc_pipefs /proc/mounts ; then
51 modprobe sunrpc >/dev/null 2>&1
52 run_cmd "Mounting /var/lib/nfs/rpc_pipefs filesystem" \
53 mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs
56 msg_starting "RPC idmapd"
57 daemon rpc.idmapd $RPCIDMAPOPTIONS
59 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/idmapd
61 msg_already_running "RPC idmapd"
66 if [ -f /var/lock/subsys/idmapd ]; then
67 msg_stopping "RPC idmapd"
69 rm -f /var/lock/subsys/idmapd
71 msg_not_running "RPC idmapd"
75 # See how we were called.
93 if [ -f /var/lock/subsys/idmapd ]; then
94 msg_reloading "RPC idmapd"
95 killproc rpc.idmapd -HUP
98 msg_not_running "RPC idmapd" >&2
103 msg_usage "$0 {start|stop|restart|reload|status}"