Sophie

Sophie

distrib > Mandriva > 2009.0 > x86_64 > by-pkgid > 6be44af0a222e724ca62575f31111553 > files > 5

rpcbind-0.1.5-2mdv2009.0.src.rpm

#!/bin/sh
#
# chkconfig: 345 11 89
# description: Start the rpcbind daemon

### BEGIN INIT INFO
# Provides: $portmap
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 3 4 5
# Short-Description: Start the rpcbind daemon
# Description: The rpcbind utility is a server that converts RPC program
#              numbers into universal addresses. It must be running on the
#              host to be able to make RPC calls on a server on that machine.
### END INIT INFO

# Source function library.
. /etc/rc.d/init.d/functions

# Get network configuration
. /etc/sysconfig/network

# Check that networking is up.
[ "${NETWORKING}" = "no" ] && exit 0

[ -f /sbin/rpcbind ] || exit 0

[ -f /etc/sysconfig/rpcbind ] && . /etc/sysconfig/rpcbind

RETVAL=0

start() {
    echo -n "Starting rpcbind: "
    # try warm start if the file exists
    if [ -f /var/lib/rpcbind/rpcbind.file ]; then
	RPCBIND_OPTIONS="$RPCBIND_OPTIONS -w"
    fi
    daemon rpcbind $RPCBIND_OPTIONS
    RETVAL=$?
    echo
    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/rpcbind
    return $RETVAL
}

stop() {
    echo -n $"Stopping rpcbind: "
    killproc rpcbind
    RETVAL=$?
    echo
    [ $RETVAL -eq 0 ] && {
	rm -f /var/lock/subsys/rpcbind
	rm -f /var/run/rpcbind*
    }
    return $RETVAL
}

# See how we were called.
case "$1" in
    start)
	start
	;;
    stop)
	stop
	;;
    status)
	status rpcbind
	;;
    restart|reload)
        stop
        start
	;;
    condrestart)
	[ -f /var/lock/subsys/rpcbind ] && restart || :
	;;
    *)
	echo "Usage: $0 {start|stop|status|restart|reload|condrestart}"
	exit 1
esac

exit $?