#!/usr/bin/ksh93 # ALTRAN_PROLOG_BEGIN_TAG # This is an automatically generated prolog. # # Copyright (C) Altran ACT S.A.S. 2019,2021. All rights reserved. # # ALTRAN_PROLOG_END_TAG # # @(#) 7d4c34b 43haes/usr/sbin/cluster/sa/wmq/sbin/cl_wmq_startlsnr.sh, 726, 2147A_aha726, Feb 05 2021 09:50 PM ######################################################################################### # # NAME: # cl_wmq_startlsnr # # PURPOSE: # This script is intended to use by PowerHA to start the specified mq listener. # # Flags/Arguments: # u : MQM user name. # m : MQ instance name. # l : MQ listener name. # # RETURNS: 0 on success # 1 on failure ############################################################################### function start_mqlsnr { [[ "$VERBOSE_LOGGING" == "high" ]] && set -x KLIB_SA_logmsg INFO 2 12 wmq_sa.cat "Starting the WebSphere MQ listener %1\$s \ associated with Queue Manager %2\$s" $LSNR $QM echo "START LISTENER($LSNR)" | /usr/bin/su $MQU -c "/usr/mqm/bin/runmqsc $QM" RC=$? # listener started successfully (( $RC == 0 )) && { KLIB_SA_logmsg INFO 2 13 wmq_sa.cat "Successfully started the WebSphere \ MQ listener %1\$s associated with Queue Manager %2\$s" $LSNR $QM return 0 } # listener is already up and running (( $RC == 10 )) && { KLIB_SA_logmsg INFO 2 14 wmq_sa.cat "WebSphere MQ listener %1\$s \ associated with Queue Manager %2\$s is already up and running" $LSNR $QM return 0 } # Failure while starting the listener KLIB_SA_logmsg ERROR 2 15 wmq_sa.cat "Failed while starting the WebSphere \ MQ listener %1\$s associated with Queue Manager %2\$s.\n\ Make sure Queue Manager is up and running." $LSNR $QM return $RC } ############ #MAIN ############ [[ "$VERBOSE_LOGGING" == "high" ]] && set -x . /usr/es/sbin/cluster/sa/wmq/sbin/cl_wmq_Globals typeset MQU typeset QM typeset LSNR while getopts u:m:l: opt do case $opt in u)# MQ User name. MQU=$OPTARG ;; m)# QM instance name. QM=$OPTARG ;; l)# MQ Listener name. LSNR=$OPTARG ;; esac done [[ -z $MQU || -z $QM || -z $LSNR ]] && exit 1 start_mqlsnr