X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=etc%2Fredhat%2Frpcidmapd.init;fp=etc%2Fredhat%2Frpcidmapd.init;h=63ee08cc1d8832073d5273954d366f1a024cb192;hp=0000000000000000000000000000000000000000;hb=553caba3865667724291106d919e7c3fdf9534aa;hpb=fcb905a5392c31a4c31e7d9e616e691d61358731 diff --git a/etc/redhat/rpcidmapd.init b/etc/redhat/rpcidmapd.init new file mode 100644 index 0000000..63ee08c --- /dev/null +++ b/etc/redhat/rpcidmapd.init @@ -0,0 +1,70 @@ +#!/bin/bash +# +# rpcidmapd Start up and shut down RPC name to UID/GID mapper +# +# Authors: Chuck Lever +# +# chkconfig: 0356 19 69 +# description: Starts user-level daemon for NFSv4 that maps user \ +# names to UID and GID numbers. + +# Source function library. +. /etc/init.d/functions + +# Source networking configuration. +if [ ! -f /etc/sysconfig/network ]; then + exit 0 +fi +. /etc/sysconfig/network + +# Check that networking is up. +[ "${NETWORKING}" = "no" ] && exit 0 + +[ ! -x /usr/sbin/rpc.idmapd ] && exit 0 + +OPTIONS="" +RETVAL=0 +prog="rpc.idmapd" + +case "$1" in + start) + # make sure the rpc pipe fs is mounted already + RPCMTAB=`grep -v '^#' /proc/mounts | awk '{ if ($3 ~ /^rpc_pipefs$/ ) print $2}'` + if [ -n "$RPCMTAB" ]; then + # Start daemon. + echo -n $"Starting $prog: " + daemon /usr/sbin/rpc.idmapd ${OPTIONS} -p ${RPCMTAB}/nfs + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/rpc.idmapd + fi + ;; + stop) + # Stop daemon. + echo -n $"Shutting down $prog: " + killproc $prog + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/rpc.idmapd + ;; + status) + status rpc.idmapd + RETVAL=$? + ;; + restart|reload) + $0 stop + $0 start + RETVAL=$? + ;; + condrestart) + if [ -f /var/lock/subsys/rpc.idmapd ]; then + $0 restart + RETVAL=$? + fi + ;; + *) + echo $"Usage: $0 {start|stop|restart|condrestart|status}" + exit 1 +esac + +exit $RETVAL