Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > media > main-release > by-pkgid > bd6e935169b1faa009847b2d300db584 > files > 2

rpcbind-0.1.4-10mdv2008.1.x86_64.rpm

#! /bin/sh
#
# rpcbind       Start/Stop RPCbind
#
# chkconfig: 345 11 89
# 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.
#
# processname: rpcbind
# probe: true
# config: /etc/sysconfig/rpcbind

### BEGIN INIT INFO
# Provides: $portmap
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 3 4 5
# Short-Description: RPCbind
# 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

# This is an interactive program, we need the current locale
[ -f /etc/profile.d/lang.sh ] && . /etc/profile.d/lang.sh
# We can't Japanese on normal console at boot time, so force LANG=C.
if [ "$LANG" = "ja" -o "$LANG" = "ja_JP.eucJP" ]; then
    if [ "$TERM" = "linux" ] ; then
        LANG=C
    fi
fi

# 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() {
        gprintf "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() {
        gprintf "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 || :
	;;
  *)
	gprintf "Usage: %s {start|stop|status|restart|reload|condrestart}\n" "$0"
	exit 1
esac

exit $?