Setting up HP SIM 5.x on an HP-UX Serviceguard Cluster (448492-002, February 2008)

32
# Halt each service using cmhaltserv(1m).
#
function halt_services
{
for I in ${SERVICE_NAME[@]}
do
echo "$(date '+%b %e %T')
-
Node
\
"$(hostname)
\
": Haltin
g service $I"
cmhaltserv $I
test_return 9
done
}
# For each IP address/subnet pair, remove the IP address from the subnet
# using cmmodnet(1m).
#
function remove_ip_address
{
S=0
for I in ${IP[@]}
do
echo "$(date '+%b %e %T')
-
Node
\
"$(hostname)
\
": Remove IP address $I from
subnet ${SUBNET[$S]}"
XX=$( cmmodnet
-
r
-
i $I ${SUBNET[$S]} 2>&1 )
if (( $? != 0 ))
then
if echo $XX | grep "is not configured on the subnet" >/dev/null 2>&1
then
echo "$XX" >> $log_file
# `
let 0` is used to set the value of $? to 1.
# The function test_return requires $? to be set
# to 1 if it has to print error message.
let 0
test_return 12
fi
fi
(( S = $S + 1 ))
done
}
# Unmount each file sy
stem.
#
function umount_fs
{
typeset
-
i j=0
typeset
-
i L
typeset
-
i UM_CNT
typeset
-
i ret
if [[ ${GFS} == "YES" ]]
then
return 0
fi
UM_CNT=${FS_UMOUNT_COUNT:
-
1}
if (( ${UM_CNT} < 1 ))
then
UM_CNT=1
fi
L=${#LV[*]}
# Perform parallel file system umounts for better performance.
# Limit the number of parallel umounts to
# CONCURRENT_MOUNT_AND_UMOUNT_OPERATIONS