#!/bin/sh
#
# nfslock       This shell script takes care of starting and stopping
#               the NFS file locking service.
#
# chkconfig: 345 14 86
# description: NFS is a popular protocol for file sharing across \
#              TCP/IP networks. This service provides NFS file \
#              locking functionality.
# probe: true

case $1 in
  start|restart)  echo   "$1ing NFS file locking services, rpc.statd"
                  pkill  "^rpc.statd$"  &&  sleep  5
                  ps  -C  portmap  >  /dev/null  ||
                  /etc/init.d/portmap start
                  /usr/sbin/rpc.statd
                  ;;
           stop)  echo "$1ping NFS file locking services"
                  pkill  "^rpc.statd$"
                  ;;
              *)  echo "Usage $0 {start|stop|restart}"
                  ;;
esac
