Blame | Last modification | View Log | RSS feed
#!/bin/bash## rpcsvcgssd Start up and shut down RPCSEC GSS daemon## chkconfig: - 31 69# description: Starts user-level daemon that manages RPCSEC GSS contexts \# for the NFS server.### BEGIN INIT INFO# Provides: rpcsvcgssd# Required-Start: $network $syslog# Required-Stop: $network $syslog# Default-Stop: 0 1 6# Short-Description: Starts the RPCSEC GSS server daemon# Description: NFS is a popular protocol for file sharing across \# networks. This deamon manages RPCSEC GSS contexts on the# server used by secure NFS mounts### END INIT INFO# Source function library.. /etc/init.d/functions# Source networking configuration.[ -f /etc/sysconfig/network ] && . /etc/sysconfig/network# Check for and source configuration file otherwise set defaults[ -f /etc/sysconfig/nfs ] && . /etc/sysconfig/nfsRETVAL=0prog="rpc.svcgssd"LOCKFILE=/var/lock/subsys/$proguid=`id | cut -d\( -f1 | cut -d= -f2`case "$1" instart|condstart)# Check that networking is up.[ "${NETWORKING}" != "yes" ] && exit 6[ "${SECURE_NFS}" != "yes" ] && exit 6[ ! -x /usr/sbin/rpc.svcgssd ] && exit 5# Only root can start the service[ $uid -ne 0 ] && exit 4# Make sure the daemon is not already running.if status $prog > /dev/null ; thenexit 0firm -f $LOCKFILEecho -n $"Starting RPC svcgssd: "# Make sure the rpc_pipefs filesystem is available/bin/mount -t rpc_pipefs sunrpc /var/lib/nfs/rpc_pipefs > /dev/null 2>&1[ -x /sbin/lsmod -a -x /sbin/modprobe ] && {if ! /sbin/lsmod | grep rpcsec_gss_krb5 > /dev/null ; then/sbin/modprobe rpcsec_gss_krb5 || {echo "Error: Unable to load rpcsec_gss_krb5."exit 6;}fi}# Start daemon.daemon $prog ${RPCSVCGSSDARGS}RETVAL=$?echo[ $RETVAL -eq 0 ] && touch $LOCKFILE;;stop)# Just exit if not configured[ "${SECURE_NFS}" != "yes" ] && exit 6# Only root can stop the service[ $uid -ne 0 ] && exit 4# Stop daemon.echo -n $"Shutting down RPC svcgssd: "killproc $progRETVAL=$?echorm -f $LOCKFILE;;status)status rpc.svcgssdRETVAL=$?;;restart|reload|force-reload)$0 stop$0 startRETVAL=$?;;condrestart|try-restart)if [ -f $LOCKFILE ]; then$0 restartRETVAL=$?fi;;condstop)if [ -f $LOCKFILE ]; then$0 stopRETVAL=$?fi;;*)echo $"Usage: $0 {start|stop|restart|force-reload|condstart|condrestart|try-restart|status|condstop}"RETVAL=2;;esacexit $RETVAL