Author |
Message
|
Edrick |
Posted: Mon Apr 23, 2007 11:28 am Post subject: Websphere MQ and DB2 MQListener |
|
|
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 |
|
 |
fjb_saper |
Posted: Mon Apr 23, 2007 1:17 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20763 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 |
|
 |
Edrick |
Posted: Tue Apr 24, 2007 3:40 am Post subject: |
|
|
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 |
|
 |
jefflowrey |
Posted: Tue Apr 24, 2007 4:50 am Post subject: |
|
|
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 |
|
 |
Edrick |
Posted: Tue Apr 24, 2007 5:45 am Post subject: |
|
|
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 |
|
 |
|