#!/bin/sh
#
# Startup script for PVM 
#
# chkconfig: - 85 15
# description: PVM is Parallel Virtual Machine and provides the core of the \
#	       Beowulf cluster.
# processname: pvmd
# pidfile: /var/run/pvmd.pid

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

export PVM_ROOT=/usr/share/pvm3 
export PVMD_NOHOLD=ON

# See how we were called.
case "$1" in
  start)
        echo -n "Starting pvmd3: "
        export PVM_ROOT=/usr/share/pvm3
        export PVMD_NOHOLD=ON
        daemon --user pvm /usr/share/pvm3/lib/pvmd
        echo
        touch /var/lock/subsys/pvmd3
        ;;
  stop)
	echo -n "Shutting down pvmd3: "
	killproc pvmd3
	echo
	rm -f /var/lock/subsys/pvmd3
	;;
  status)
	status pvmd3
	;;
  restart)
	$0 stop
	$0 start
	;;
  *)
	echo "Usage: $0 {start|stop|restart|status}"
	exit 1
esac

exit 0
