ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General IBM MQ Support » How do I properly shutdown a listener on AIX

Post new topic  Reply to topic
 How do I properly shutdown a listener on AIX « View previous topic :: View next topic » 
Author Message
kriersd
PostPosted: Fri Jan 31, 2003 11:35 am    Post subject: How do I properly shutdown a listener on AIX Reply with quote

Master

Joined: 22 Jul 2002
Posts: 209
Location: IA, USA

Ok, MQ GURU's...

Below is a snipit of my MQWF_Shutdown KSH script. Can someone tell me if I am doing something wrong here. I am running into a strange problem.
When I run the stop script (see snipit below) everything looks like it shutdown properly. Now when I run the start script (Not shown) to bring everything back up sometimes I'll get an error pop up about 30 seconds after the start of my listeners stating that it couldn't bind to the port.

I can always resolve the issue by running the stop script (see snipit below) again and then rerunning the start script again. Now the funny thing is, the listener stays up after I rerun the stop script and then run the start script.

Code:
############################
# End the command server
############################
endmqcsv $QMANAGER

############################
endmqm $QMANAGER

i=0
while ps -ef |grep -v grep | grep qm | grep -q $QMANAGER; do
  echo "Waiting for queue manager $QMANAGER to stop"
  sleep 60
  (( i = i + 1 ))
  if [ i -ge 10 ]; then
    echo "$QMANAGER not shutting down cleanly;  Forcing shutdown"
    /usr/local/bin/unixpage.ksh -i MQWorkflow "$QMANAGER not shutting down on $HOST"
    endmqm -i $QMANAGER
    exit 1
  fi
done

########################################################################
# endmqlsr -m $QMANAGER
########################################################################


endmqlsr -m $QMANAGER

i=0
while ps -ef |grep -v grep |grep "runmqlsr -m $QMANAGER"; do
  echo "Waiting for listener on $QMANAGER to stop"
  sleep 60
  (( i = i + 1 ))
  if [ i -ge 6 ]; then
    echo "Listener on $QMANAGER did not shut down!"
    /usr/local/bin/unixpage.ksh -i MQWorkflow "Listener on $QMANAGER not shutting down on $HOST
"
    echo Forcing listeners off of system
    list=`ps -ef | grep [m]qlsr | grep $QMANAGER | awk '{ print $2 }'`
    for x in $list;do
      echo killing process $x
      kill -9 $x
    done
    exit 0
  fi
done

_________________
Dave Krier

IBM WebSphere MQ Workflow V3.4 Solution Designer
Back to top
View user's profile Send private message
mrlinux
PostPosted: Fri Jan 31, 2003 11:52 am    Post subject: Reply with quote

Grand Master

Joined: 14 Feb 2002
Posts: 1261
Location: Detroit,MI USA

Well If the order you show your script is the execuction order, you should shut down the listener first.
_________________
Jeff

IBM Certified Developer MQSeries
IBM Certified Specialist MQSeries
IBM Certified Solutions Expert MQSeries
Back to top
View user's profile Send private message Send e-mail
jsware
PostPosted: Tue Feb 04, 2003 3:19 am    Post subject: Reply with quote

Chevalier

Joined: 17 May 2001
Posts: 455

You can't shut down the listener when the queue manager is running.
Back to top
View user's profile Send private message
pgorak
PostPosted: Tue Feb 04, 2003 4:37 am    Post subject: Reply with quote

Disciple

Joined: 15 Jul 2002
Posts: 158
Location: Cracow, Poland

Quote:
You can't shut down the listener when the queue manager is running


That's rigth. David, why don't you use endmqm -w in your script, so that you wouldn't have to wait in the loop?

As to the listener - after the listener process is ended uncleanly (e.g. by killing it) you'll have to wait a while (don't know precisely how long) for the socket to be released, since it will be in FIN_WAIT state. If you run against this problem again, try to check the status of your sockets with netstat -a

Piotr
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » How do I properly shutdown a listener on AIX
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.