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 Discussion » endmqm and dltmqm in a shell script issues with endmqm

Post new topic  Reply to topic
 endmqm and dltmqm in a shell script issues with endmqm « View previous topic :: View next topic » 
Author Message
LearnMQSI
PostPosted: Thu Sep 07, 2006 3:52 pm    Post subject: endmqm and dltmqm in a shell script issues with endmqm Reply with quote

Centurion

Joined: 20 Aug 2002
Posts: 137

Hi MQ Experts,

I have around 14 Queue Managers on a Sun Solaris machine. WMQ 5.3

I wrote a shell script to end these queue managers and then delete all of them.

My endmqm having issues saying "There are more processes still running and could not be restart and stop queue manager"

of course, since its NOT able to stop queue manager, it won't be able to delete queue manager.

I tried, default endmqm and with -i and -p flag as well but does not help.

I killed those processes manually, and manually stop all queue managers, commented out endmqm command from script and ran it, it was successfully deleted all my queue managers.

Here is my script:

cd /var/mqm/qmgrs
for QM in * then
do
if [ /var/mqm/qmgrs/$QM ] then
echo Stopping Queue Manager......$PWD/$QM
endmqm -i $QM
sleep 5
echo Deleting Queue Manager.......$PWD/$QM
dltmqm $QM
fi
done

If somebody can help me here WHY my endmqm is NOT working properly?

Thank you in advance and highly appreciated for your input.

Regards,

LearnMQSI
_________________
IBM Certified System Administrator - WebSphere MQ 5.3
Back to top
View user's profile Send private message
csmith28
PostPosted: Thu Sep 07, 2006 3:55 pm    Post subject: Reply with quote

Grand Master

Joined: 15 Jul 2003
Posts: 1196
Location: Arizona

You may want to add this in an if, then else statement:

Code:
ps -ef | grep mqm | grep -v grep | awk '{print $2}' | xargs kill -9


I have noticed that sometimes the endmqm script will not end the runmqlsr process.

I'm not even going to ask why you want to delete all your MQManagers after stopping them on such a regular basis that you feel scripting it is necessary or desirable.
_________________
Yes, I am an agent of Satan but my duties are largely ceremonial.
Back to top
View user's profile Send private message
wschutz
PostPosted: Thu Sep 07, 2006 4:21 pm    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

Also, you might want to change the endmqm to:
Code:
endmqm -w <qmgr>

from the man page:
Quote:
-w
Wait shutdown.

This type of shutdown is equivalent to a controlled shutdown
except that control is returned to you only after the queue man-
ager has stopped. You receive the message "Waiting for queue
manager qmName to end" while shutdown progresses.

_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
LearnMQSI
PostPosted: Thu Sep 07, 2006 4:29 pm    Post subject: Reply with quote

Centurion

Joined: 20 Aug 2002
Posts: 137

csmith28 wrote:
You may want to add this in an if, then else statement:

Code:
ps -ef | grep mqm | grep -v grep | awk '{print $2}' | xargs kill -9


I have noticed that sometimes the endmqm script will not end the runmqlsr process.

I'm not even going to ask why you want to delete all your MQManagers after stopping them on such a regular basis that you feel scripting it is necessary or desirable.



Thank you csmith and wayne,

This is a part of my Disaster Recovery procedure, thats why we need to delete all of these queue managers.

Again, thanks a lot for your inputs, I will try them!!!

Warm Regards,

LearnMQSI
_________________
IBM Certified System Administrator - WebSphere MQ 5.3
Back to top
View user's profile Send private message
vraju
PostPosted: Thu Sep 07, 2006 7:36 pm    Post subject: Reply with quote

Novice

Joined: 24 Apr 2006
Posts: 16

Hi,
plz try this..
this is working fine.

for i in {QM Names}
do
endmqm -i $i
sleep 5
endmqlsr $i
sleep 5
dltmqm $i
done


u can do that from anywhere..
Back to top
View user's profile Send private message
dgolding
PostPosted: Fri Sep 08, 2006 12:06 am    Post subject: Reply with quote

Yatiri

Joined: 16 May 2001
Posts: 668
Location: Switzerland

csmith28 wrote:
You may want to add this in an if, then else statement:

Code:
ps -ef | grep mqm | grep -v grep | awk '{print $2}' | xargs kill -9




If you have 14 queue managers in the system, You would need an extra "grep <qmgr name>" in the command above. And the trouble with "endmqm -w" is you could actually wait for ever.

Long-running applications that don't see the queue manager shutting down signal are a constant culprit. Have you noticed which processes that are still running after the shutdown?
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General Discussion » endmqm and dltmqm in a shell script issues with endmqm
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.