Author |
Message
|
LearnMQSI |
Posted: Thu Sep 07, 2006 3:52 pm Post subject: endmqm and dltmqm in a shell script issues with endmqm |
|
|
 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 |
|
 |
csmith28 |
Posted: Thu Sep 07, 2006 3:55 pm Post subject: |
|
|
 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 |
|
 |
wschutz |
Posted: Thu Sep 07, 2006 4:21 pm Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Also, you might want to change the endmqm to:
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 |
|
 |
LearnMQSI |
Posted: Thu Sep 07, 2006 4:29 pm Post subject: |
|
|
 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 |
|
 |
vraju |
Posted: Thu Sep 07, 2006 7:36 pm Post subject: |
|
|
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 |
|
 |
dgolding |
Posted: Fri Sep 08, 2006 12:06 am Post subject: |
|
|
 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 |
|
 |
|