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

31
YY=$( ifco
nfig | awk '$2 == "'addr:${I}'"')
if [[
-
z "${YY}" ]]
then
echo "$XX" >> $log_file
echo "ERROR: Failed to add IP $I to subnet ${SUBNET[$S]}"
(( error = 1 ))
else
echo "WARNING: IP $I is already configured on the subnet
${SUB
NET[$S]}"
fi
fi
fi
(( S = $S + 1 ))
done
if (( error != 0 ))
then
# `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 4
fi
}
# For each {service name/service command string} pair, start the
# service command string at the service name using cmrunserv(1m).
#
function start_services
{
C=0
for I in ${SERVICE_NAME[@]}
do
echo "$(date '+%b %e %T')
-
Node
\
"$(ho
stname)
\
": Starting service $I
using"
echo
-
e "
\
t
\
"${SERVICE_CMD[$C]}
\
""
# Check if cmrunserv should be called the old
# way without a restart count.
if [[ "${SERVICE_RESTART[$C]}" = "" ]]
then
cmrunserv $I ">> $log_file
2>&1 ${SERVICE_CMD[$C]}"
else
# Do not attempt to restart when SERVICE_CMD does not exist or
# does not have executable permission(JAGag12644)
# Extract the service script name first from the SERVICE_CMD
# and then check
for the execute permission
if [[ !
-
x ${SERVICE_CMD[$C]%% *} ]]
then
cmrunserv $I ">> $log_file 2>&1 ${SERVICE_CMD[$C]}"
else
cmrunserv ${SERVICE_RESTART[$C]} $I ">> $log_file 2>&1
${SERVICE_CMD[$C]}"
fi
fi
test_re
turn 8
(( C = $C + 1 ))
done
}
# END OF RUN FUNCTIONS.
# START OF HALT FUNCTIONS