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 » Websphere MQ and DB2 MQListener

Post new topic  Reply to topic
 Websphere MQ and DB2 MQListener « View previous topic :: View next topic » 
Author Message
Edrick
PostPosted: Mon Apr 23, 2007 11:28 am    Post subject: Websphere MQ and DB2 MQListener Reply with quote

Novice

Joined: 23 Apr 2007
Posts: 10

I have created a system that receives a message and calls a DB2 stored procedure to process it via a db2mqlsn command (on windows). Now I'm migrating the system to linux and the only thing left for me to do, is to setup the db2mqls to start automatically after the MQ manager starts.
My problem is that running the command won't return a result (because it keeps running indefinitedly). What I want to know is how can I setup a command call like that in the script that I have created that starts my MQ manager at boot (on /etc/init.d/).

Here's part of what I got on the script (on /etc/init.d/):
su - mqm -c "cd /opt/mqm/bin; ./strmqm MYQUEUEMANAGER "
su - db2inst1 -c "cd /opt/ibm/db2/V9.1/bin; ./db2mqlsn run -configDB MYDB -config mydbconfig"

It runs but gives a nil return error (because the 2nd command keeps running without returning) and will show as stopped in the system services (but it do run the commands). Can someone point me in the right direction or at least tell my how to specify a command like this at boot?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Apr 23, 2007 1:17 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

You might want to put the command into the background. At the end of the command just put a '&':

Code:
runmqlsr -m MYQMGR -t tcp -p 1414 &

_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Edrick
PostPosted: Tue Apr 24, 2007 3:40 am    Post subject: Reply with quote

Novice

Joined: 23 Apr 2007
Posts: 10

I tried your suggestion. But it still returns a nil (I think it is because of the timeout of the non-returning command) when I test it on YaST2 service manager. I tested the command on a terminal window and here is how it runs:
SRV-LX-01:/ # su - db2inst1 -c "cd /opt/ibm/db2/V9.1/bin; ./db2mqlsn run -configDB MYDB -config mydbconfig" &
[1] 12368
SRV-LX-01:/ # MQL0073I MQListener started a thread running the task specified in the configuration "mydbconfig" by the input queue "QUERYQUEUE" and queue manager "MYQUEUEMANAGER".
MQL0073I MQListener started a thread running the task specified in the configuration "mydbconfig" by the input queue "REGISTERQUEUE" and queue manager "MYQUEUEMANAGER".


and the command keeps running indefinitely (that's why it doesn't return a value)
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Apr 24, 2007 4:50 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Put the & inside the "
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Edrick
PostPosted: Tue Apr 24, 2007 5:45 am    Post subject: Reply with quote

Novice

Joined: 23 Apr 2007
Posts: 10

I tried,

SRV-LX-01:/ # su - db2inst1 -c "cd /opt/ibm/db2/V9.1/bin; ./db2mqlsn run -configDB MYDB -config mydbconfig &"
SRV-LX-01:/ # MQL0073I MQListener started a thread running the task specified in the configuration "mydbconfig" by the input queue "QUERYQUEUE" and queue manager "MYQUEUEMANAGER".
MQL0073I MQListener started a thread running the task specified in the configuration "mydbconfig" by the input queue "REGISTERQUEUE" and queue manager "MYQUEUEMANAGER".



with similar result (no return and then no boot db2mqlsn started).
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 Discussion » Websphere MQ and DB2 MQListener
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.