#!/bin/ksh # This script starts and stops the cricket_server.pl # script. This script is used to gather information # from the cluster and report it to remote applications. # This will set the LD_LIBRARY_PATH to the right value, and set loads of other # things. . /opt/wildfire/etc/wfdb.rc CRICKET_PATH=/opt/wildfire/tools case "$1" in 'start') # Start the cricket server so data can be collected # off of the cluster to a remote site if [ -x $CRICKET_PATH/cricket_server.pl ]; then echo "Starting cricket_server.pl" su - wf -c '/opt/wildfire/tools/cricket_server.pl &' if [ "$?" = "0" ]; then echo " cricket_server.pl startup succeeded" else echo " cricket_server.pl startup failed" fi else echo " Could not find cricket_server.pl" echo " I was told cricket lives here: $CRICKET_PATH" fi ;; 'stop') kill -3 `/usr/bin/ps -ef | grep cricket_server | grep -v grep | awk '{print $2}'` if [ "$?" = "0" ]; then echo " cricket_server.pl shutdown succeeded" else echo " cricket_server.pl shutdown failed" fi ;; *) echo "Usage: $0 { start | stop }" ;; esac