#!/bin/sh
########################################################################
# Begin rpcbind
#
# Description : Start rpcbind daemon
#
# Author      : Ken Moffat - ken@linuxfromscratch.org, based on portmap
#               script by Bruce Dubbs
#
# Version     : BLFS 7.0
#
########################################################################

### BEGIN INIT INFO
# Provides:            rpcbind $portmap
# Required-Start:      $network
# Should-Start:        networkmanager wicd
# Required-Stop:       $network
# Should-Stop:         networkmanager wicd
# Default-Start:       2 3 4 5
# Default-Stop:        0 1 6
# Short-Description:   Starts the rpcbind daemon.
# Description:         Starts the rpcbind daemon to convert RPC program numbers
#                      into DARPA protocol port numbers. It must be running in
#                      order to make RPC# calls.  Replaces portmap, which does
#                      not work with libtirpc.
# X-LFS-Provided-By:   BLFS
### END INIT INFO

. /lib/lsb/init-functions

case "$1" in
   start)
      log_info_msg "Starting rpcbind"
      start_daemon /usr/sbin/rpcbind
      evaluate_retval
      ;;

   stop)
      log_info_msg "Stopping rpcbind"
      killproc /usr/sbin/rpcbind
      evaluate_retval
      ;;

   restart)
      $0 stop
      sleep 1
      $0 start
      ;;

   status)
      statusproc /usr/sbin/rpcbind
      ;;

   *)
      echo "Usage: $0 {start|stop|restart|status}"
      exit 1
      ;;

esac

# End /etc/init.d/rpcbind
