Setting up an HP SIM server 6.0 or greater on a Linux-based Serviceguard Cluster White Paper 444847-004, February 2010

34
# `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 cmru
nserv(1m).
#
function start_services
{
C=0
for I in ${SERVICE_NAME[@]}
do
echo "$(date '+%b %e %T')
-
Node
\
"$(hostname)
\
": 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 executabl
e 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 ${SERVIC
E_CMD[$C]}"
else
cmrunserv ${SERVICE_RESTART[$C]} $I ">> $log_file 2>&1
${SERVICE_CMD[$C]}"
fi
fi
test_return 8
(( C = $C + 1 ))
done
}
# END OF RUN FUNCTIONS.
# START OF HALT FUNCTIONS
# Halt each service using cmhaltserv(1m
).
#
function halt_services
{
for I in ${SERVICE_NAME[@]}
do