I use two different shell scripts. If I want to stop every site call the stop_CL_everything script
It has this code in it:
for site in `ls -1d /hci/cis5.8/integrator/*/exec | grep exec | grep -v siteProto | cut -d”/” -f5`
do
echo “Stopping site $site…”
/hci/cis5.8/integrator/usercmds/stop_site $site &
sleep 5
done
echo “Waiting…”
wait
echo ‘Cloverleaf Jobs are done’
The stop_site shell script looks like this:
#!/usr/bin/ksh
user=$(whoami)
if [ $user != “hci” ]
then
echo “You must be user hci to run this script.”
exit
fi
typeset -i recnum
typeset -i errnum
typeset -i err
err=0
if [[ -z $1 ]]
then
echo “”
echo ” ** Need to supply a site. Can not run without a site”
echo “”
exit
fi
site=$1
autoload setroot
setroot /hci/cis5.8/integrator $site
for proc in `hciprocstatus|sed 1,2d|cut -d” ” -f1`
do
echo “Shutting Down Process – $proc”
hcienginestop -p $proc &
done
echo “”
echo “nnWaiting for stopping processes…”
wait
echo “Stopping Deamons”
hcisitectl -Kf
echo “”
sleep 10
echo “checking to make sure that the Monitor Deamon is stopped…”
echo “Checking Monitor…”
if [[ -a /hci/cis5.8/integrator/$site/exec/hcimonitord/pid ]]
then
PID=$(cat /hci/cis5.8/integrator/$site/exec/hcimonitord/pid)
echo “Checking for process id of – $PID”
ps -ef | grep -q $PID
if [[ $? -eq 1 ]]
then
echo “Site: $site is not really running even though it has a monitor daemon pid file”
else
echo “Killing the running Monitor Deamons”
kill -9 $PID
fi
else
echo “Monitor is not running.”
fi
sleep 10
echo “Done.”
exit
Let me know if you need anything explained.
Rob