#!/bin/sh # # /etc/init.d/harvest - start/stop the httpd-related daemons # # First, set up some useful variables. HOME=/; export HOME PATH=/bin:/usr/ucb:/usr/sbin:/etc:/sbin; export PATH umask 022 # the paths and parameters for things we run. R_GATHERD=/opt/harvest/gatherers/vsis-www/RunGatherd R_BROKER=/opt/harvest/brokers/vsis-www/RunBroker BROKER_OPTS=-nocol # Don't redo collection on startup ### uncomment these if there seems to be a problem starting up. # RUNLOG_G=/usr/tmp/www-run-log.gatherd # RUNLOG_B=/usr/tmp/www-run-log.broker RUNLOG_G=/dev/null RUNLOG_B=/dev/null case $1 in 'start') echo "Starting Harvest daemons:" #>/dev/console if [ -f ${R_GATHERD} ]; then echo " gatherd...\c" #>/dev/console # /bin/su - wwwharv -c ${R_GATHERD} >${RUNLOG_G} 2>&1 ${R_GATHERD} >${RUNLOG_G} 2>&1 fi sleep 2 if [ -f ${R_BROKER} ]; then echo " broker...\c" #>/dev/console # /bin/su - wwwharv -c "${R_BROKER} ${BROKER_OPTS}" >${RUNLOG_B} 2>&1 ${R_BROKER} ${BROKER_OPTS} >${RUNLOG_B} 2>&1 fi echo " done!" #>/dev/console ;; 'stop') echo "Stopping Harvest daemons." #>/dev/console pid=`/bin/ps -x | /usr/bin/awk -- '($5~/^gatherd/) {print $1}'` if test "$pid" then kill $pid fi pid=`/bin/ps -x | /usr/bin/awk -- '($5~/^broker/) {print $1}'` if test "$pid" then kill $pid fi ;; *) echo "usage: /etc/init.d/harvest {start|stop}" ;; esac