Appendix A. HA scripts 203
wics_ha_stop
#! /usr/bin/sh
# WICS Stop Script for HACMP 5.1
# Initialize variables
QM_NAME=ics422.queue.manager
CROSSWORLDS=/opt/IBM/WebSphereICS
HOST=`/bin/hostname -s`
PROGID=`echo $0 | sed 's%/usr/bin/%%g'`
echo "Entering WICSHA Stop"
# Stop Connector REQJDBC
echo "$PROGID - $HOST: Stopping Connector REQJDBC. `date`"
su - cwadmin '-c $CROSSWORLDS/bin/connector_manager_REQJDBC -stop'
resultvar=$?
if [ ${resultvar} -ne 0 ]
then
echo "$PROGID - $HOST - Return code $resultvar: Did not stop Connector
REQJDBC. `date`"
fi
# Stop Connector ORDJDBC
echo "$PROGID - $HOST: Stopping Connector ORDJDBC. `date`"
su - cwadmin '-c $CROSSWORLDS/bin/connector_manager_ORDJDBC -stop'
resultvar=$?
if [ ${resultvar} -ne 0 ]
then
echo "$PROGID - $HOST - Return code $resultvar: Did not stop Connector
ORDJDBC. `date`"
fi
# Stop Connector WMQI
echo "$PROGID - $HOST: Stopping Connector WBIMB `date`"
su - cwadmin '-c $CROSSWORLDS/bin/connector_manager_WBIMB -stop'
resultvar=$?
if [ ${resultvar} -ne 0 ]
then
echo "$PROGID - $HOST - Return code $resultvar: Did not stop Connector WBIMB.
`date`"
fi
# Stop WICS
echo "$PROGID - $HOST: Stopping ICS. `date`"
su - cwadmin '-c $CROSSWORLDS/bin/ics_manager -stopgraceful'
resultvar=$?
if [ ${resultvar} -ne 0 ]
then
su - cwadmin '-c $CROSSWORLDS/bin/ics_manager -stop'
resultvar=$?
if [ ${resultvar} -ne 0 ]
then
204 Highly Available WebSphere Business Integration Solutions
echo "WICS -stop failed, attempting to kill WICS process"
su - cwadmin '-c $CROSSWORLDS/bin/ics_manager -kill'
if [ ${resultvar} -ne 0 ]
then
echo "$PROGID - $HOST - Return code $resultvar: Could not kill ICS.
`date`"
exit $resultvar
fi
fi
fi
# Stop MQSeries
echo "$PROGID - $HOST: Stopping MQSeries. `date`"
su cwadmin -c $CROSSWORLDS/bin/hascripts/mq/hamqm_stop_su $QM_NAME 10
$CROSSWORLDS/bin/hascripts/mq
resultvar=$?
if [ ${resultvar} -ne 0 ]
then
echo "$PROGID - $HOST - Return code $resultvar: Did not stop MQSeries.
`date`"
notStopped=$resultvar
fi
# Stop IBM ORB
su - cwadmin '-c $CROSSWORLDS/bin/hascripts/wics_orb_stop'
resultvar=$?
if [ ${resultvar} -ne 0 ]
then
echo "$PROGID - $HOST - Return code $resultvar: Could not stop IBM ORB.
`date`"
exit $resultvar
fi
sleep 60
echo "WICSHA Stop Complete"
exit 0

Get Highly Available WebSphere Business Integration Solutions now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.