HP-UX SNAplus2 R7 Administration Guide

Appendix DUsing SNAplus2 in a High Availability Environment
while (( $exitcode == 0 ))
do
#
# Attempt to start the node. If it is already active,
# the command will have no effect.
#
snapadmin init_node
#
# Attempt to start the port. If it is already active,
# the command will have no effect.
#
snapadmin start_port, port_name=TRPORT
#
# Attempt to start the LS. If the LS is configured to
# be initially active, the command will have no effect.
#
snapadmin start_ls, ls_name=TRLS
#
# Monitor the primary LS again to see if local restart
# was successful. Only allow 30 seconds for the LS to
# become active.
#
snapmon -i1 -r30 TRLS
#
# Since snapmon returned, the LS is no longer active.
# Save the exit code. An exit code of zero means the
# LS was active at one time, so try local restart again.
# Otherwise, go to Step 2.
#
exitcode=$?
done
#-------------------------------------------------------------
# STEP 2: Local failover
#-------------------------------------------------------------
#
# Since snapmon returned with a non-zero exit code, the primary
# LS cannot be activated. Attempted local failover, which
# means:
#
# 1. Start the backup LS.
#
# NOTE: The active node must be configured to run the backup
# LS.
#
snapadmin start_ls, ls_name=SDLCLS
#
# Monitor the backup LS to see if local failover was
# successful. Allow 90 seconds for the LS to become active.
#
snapmon -i1 -r90 SDLCLS
#-------------------------------------------------------------
#STEP 3: Exit
#-------------------------------------------------------------
#
# Since snapmon returned, the backup LS is not active. Inform
# ServiceGuard that this package has failed. ServiceGuard will
# perform remote failover.
exit 0
226