[AG-TECH] Problem with the beacon?
Hubert Daugherty
hd at rice.edu
Mon Apr 21 22:52:38 CDT 2003
Hi,
I wrote this script for the Beacon Client when I installed it
on Solaris. I wanted a script to automatically start the beacon client
if the machine was restarted.
It might be of help in insuring a reliable stop and start because the
script
looks for the "Beacon" in the java command line. This method insures
the java process is what gets killed.
Hubert
============================
#!/bin/sh
#
# Startup for Beacon daemon
#
case "$1" in
'start')
if [ -x /usr/site/beaconclient/start_beacon.ag ]; then
echo "Beacon Client"
/usr/site/beaconclient/start_beacon.ag 1> /dev/console
2>&1 &
fi
;;
'stop')
PID=`/usr/bin/ps -ef | grep Beacon | awk '{print $2}'`
if [ ! -z "$PID" ] ; then
/usr/bin/kill ${PID} 1> /dev/null 2>&1
fi
;;
'restart')
PID=`/usr/bin/ps -ef | grep Beacon | awk '{print $2}'`
if [ ! -z "$PID" ]; then
/usr/bin/kill ${PID} 1> /dev/null 2>&1
fi
sleep 1
if [ -x /usr/site/beaconclient/start_beacon.ag ]; then
echo "Beacon client"
/usr/site/beaconclient/start_beacon.ag 1> /dev/console
2>&1 &
fi
;;
*)
echo "Usage: /etc/init.d/BeaconClient { start | stop | restart }"
;;
esac
exit 0
======================================
--
Hubert Daugherty Rice University / Rice Multimedia and E-COT Project
hd at rice.edu (713) 348-4035 Fax (713) 348-6099
insight + planning + funding + participation + documentation = creation
More information about the ag-tech
mailing list