#!/bin/sh
#
# pbsmom: This script will start and stop the PBS executor
#
# description: PBS is a versatile batch system for SMPs and clusters
#


# Source function library.
. /etc/rc.d/init.d/functions

RETVAL=0

# See how we were called.
case "$1" in
  start)
	echo -n "Starting PBS Executor: "
	daemon pbs_mom
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/pbs_mom
	;;
  stop)
	echo -n "Stopping PBS Executor: "
	killproc pbs_mom
	RETVAL=$?
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/pbs_mom
        echo
	;;
  status)
	status pbs_mom
	RETVAL=$?
	;;
  restart)
	$0 stop
	$0 start
	RETVAL=$?
	;;
  *)
	echo "Usage: $0 {start|stop|status|restart}"
	exit 1
esac

exit $RETVAL
