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?
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)
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).
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