#!/bin/sh # # dnotify-pbs_server This shell script takes care of starting and stopping # the dnotify daemon used to send PBS job script # submissions to a database for support and analysis # purposes. # # chkconfig: 2345 89 71 # description: PBS manages batch jobs for the system. # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. [ ${NETWORKING} = "no" ] && exit 0 export PBS_INSTALL=/usr/local/pbs LOCKFILE=/var/lock/subsys/dnotify-pbs PIDFILE=/var/run/dnotify-pbs.pid export PATH="${PBS_INSTALL}/sbin:${PBS_INSTALL}/bin:/usr/local/sbin:${PATH}" # See how we were called. case "$1" in start) # Start daemons. echo -n "Starting PBS dnotify: " daemon dnotify-pbs $args RETVAL=$? [ "$RETVAL" = 0 ] && touch $LOCKFILE \ && pidofproc dnotify-pbs > $PIDFILE echo ;; stop) # Stop daemons. echo -n "Shutting down PBS dnotify: " killproc dnotify-pbs RETVAL=$? [ "$RETVAL" = 0 ] && rm -f $LOCKFILE \ && rm -f $PIDFILE echo ;; restart) $0 stop $0 start ;; *) echo "Usage: dnotify-pbs {start|stop|restart}" exit 1 esac exit 0