c671507
#! /bin/sh
c671507
#
c671507
# rpcbind       Start/Stop RPCbind
c671507
#
c671507
# chkconfig: 345 13 87
c671507
# description: The rpcbind utility is a server that converts RPC program \
c671507
#              numbers into universal addresses. It must be running on the \
c671507
#              host to be able to make RPC calls on a server on that machine.
c671507
#
c671507
# processname: rpcbind
c671507
# probe: true
c671507
# config: /etc/sysconfig/nfs
c671507
c671507
c671507
c671507
# This is an interactive program, we need the current locale
c671507
[ -f /etc/profile.d/lang.sh ] && . /etc/profile.d/lang.sh
c671507
# We can't Japanese on normal console at boot time, so force LANG=C.
c671507
if [ "$LANG" = "ja" -o "$LANG" = "ja_JP.eucJP" ]; then
c671507
    if [ "$TERM" = "linux" ] ; then
c671507
        LANG=C
c671507
    fi
c671507
fi
c671507
c671507
# Source function library.
c671507
. /etc/init.d/functions
c671507
c671507
# Get config.
c671507
if [ -f /etc/sysconfig/network ]; then
c671507
    . /etc/sysconfig/network
c671507
else
c671507
    echo $"Networking not configured - exiting"
c671507
    exit 1
c671507
fi
c671507
c671507
prog="rpcbind"
c671507
c671507
# Check that networking is up.
c671507
if [ "$NETWORKING" = "no" ]; then
c671507
	exit 0
c671507
fi
c671507
f766b07
[ -f /sbin/$prog ] || exit 0
c671507
c671507
[ -f /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
c671507
c671507
RETVAL=0
c671507
c671507
start() {
c671507
        echo -n $"Starting $prog: "
c671507
        daemon $prog $RPCBIND_ARGS
c671507
        RETVAL=$?
c671507
        echo
c671507
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
c671507
	return $RETVAL
c671507
}
c671507
c671507
c671507
stop() {
c671507
        echo -n $"Stopping $prog: "
c671507
        killproc $prog
c671507
        RETVAL=$?
c671507
        echo
d16c7a4
        [ $RETVAL -eq 0 ] && {
d16c7a4
			rm -f /var/lock/subsys/$prog
d16c7a4
			rm -f /var/run/rpcbind*
d16c7a4
		}
c671507
	return $RETVAL
c671507
}
c671507
c671507
# See how we were called.
c671507
case "$1" in
c671507
  start)
c671507
	start
c671507
	;;
c671507
  stop)
c671507
	stop
c671507
	;;
c671507
  status)
c671507
	status $prog
c671507
	;;
c671507
  restart|reload)
c671507
	$0 stop
c671507
	$0 start
c671507
	;;
c671507
  condrestart)
c671507
	[ -f /var/lock/subsys/$prog ] && restart || :
c671507
	;;
c671507
  *)
c671507
	echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}"
c671507
	exit 1
c671507
esac
c671507
c671507
exit $?