Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > c56375966e6b0fac3dae4f3b23902319 > files > 10

rpcbind-0.1.4-8mdv2008.0.src.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() {
        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 $?