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 » IBM MQ Installation/Configuration Support » runmqdlq service on linux

Post new topic  Reply to topic Goto page 1, 2, 3  Next
 runmqdlq service on linux « View previous topic :: View next topic » 
Author Message
cevans
PostPosted: Fri Apr 25, 2014 2:56 am    Post subject: runmqdlq service on linux Reply with quote

Apprentice

Joined: 18 Jul 2013
Posts: 26

I have a problem configuring a service on a 7.5 Linux installation.

I have a rules file that works fine when checked by invoking runmqdlq at the command line.

*
* DLQ Handler Rules File
*
* Control Data
INPUTQ('MQDBK02_DLQ') INPUTQM('MQDBK02') RETRYINT(60) WAIT(YES)
*
* Individual Rule Entries
* -----------------------
*
* Discard event logging messages if the queue is full
DESTQ(PROJECT.DCS.RECORD) REASON(MQRC_Q_FULL) ACTION(DISCARD)
*
* Catch all to move remaining DLQ messages to system dlq
ACTION(FWD) FWDQ(SYSTEM.DEAD.LETTER.QUEUE) HEADER(YES)

The Service is defined as follows ..

Name: DLQHANDLER
Control: Manual
Start Command: /opt/mqm/bin/runmqdlq
Start Args: 'MQDBK02_DLQ MQDBK02 </var/mqm/qmgrs/MQDBK02/runmqdlq.rules'
StdOut: /var/mqm/log/MQDBK02/runmqdlq.log
StdErr: /var/mqm/log/MQDBK02/runmqdlq.err
Type: Server


When the Service is started I get the following in the StdErr file

syntax error on line 1
...04/25/2014 11:21:04 AM AMQ8758: 1 errors detected in input to runmqdlq.
04/25/2014 11:21:04 AM AMQ8709: Dead-letter queue handler ending.

I can see several previous posts in relation to Windows but nothing to do with Linux and could not see anything that looked of relevance to my problem.

Thanks
Back to top
View user's profile Send private message
exerk
PostPosted: Fri Apr 25, 2014 3:42 am    Post subject: Reply with quote

Jedi Council

Joined: 02 Nov 2006
Posts: 6339

Have a read of THIS, especially the part about 'the first entry in the table'.
_________________
It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys.
Back to top
View user's profile Send private message
cevans
PostPosted: Fri Apr 25, 2014 3:47 am    Post subject: Reply with quote

Apprentice

Joined: 18 Jul 2013
Posts: 26

exerk wrote:
Have a read of THIS, especially the part about 'the first entry in the table'.


I have read this and I believe the rules file is fine. As indicated it runs fine when executed directly at the command line. If there was a defect in the file it would be highlighted at that time also.

My suspicion is that the problem is the way the service is defined and I am unable to find any advice on the definition of the dlq handler within a Linux environment.

Thanks
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Apr 25, 2014 4:52 am    Post subject: Reply with quote

Grand High Poobah

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

For your service, have you tried escaping the redirect character?
Code:
Start Args: 'MQDBK02_DLQ MQDBK02 \< /var/mqm/qmgrs/MQDBK02/runmqdlq.rules'

If this is of no help you may need to write a little script to call the dlqhandler.

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
cevans
PostPosted: Fri Apr 25, 2014 5:08 am    Post subject: Reply with quote

Apprentice

Joined: 18 Jul 2013
Posts: 26

fjb_saper wrote:
For your service, have you tried escaping the redirect character?
Code:
Start Args: 'MQDBK02_DLQ MQDBK02 \< /var/mqm/qmgrs/MQDBK02/runmqdlq.rules'

If this is of no help you may need to write a little script to call the dlqhandler.


I just tried using \< and saqw the same results

I have now moved the runmqdlq with parameters to a .sh file so that it executes in the same way as from the command line.
I amended the service definition as follows

Start Command: /var/mqm/qmgrs/MQDBK02/dlqhandler.sh
Start Args:

The dlqhandler.sh contains the following
/opt/mqm/bin/runmqdlq MQDBK02_DLQ MQDBK02 </var/mqm/qmgrs/MQDBK02/runmqdlq.rules

Some positive and some not so positive results.
1. The error message has now gone
2. However, the service starts and promptly ends
There is no error identified in errors/AMQERR01.LOG, just that runmqdlq started and then ended.

Any ideas as to what has happened?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Apr 25, 2014 5:18 am    Post subject: Reply with quote

Grand High Poobah

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

may be you need to put it into the background.

Try starting it as
Code:
nohup runmqdlq $1 $2 < $3
or
Code:
runmqdlq $1 $2 < $3 &


have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
cevans
PostPosted: Fri Apr 25, 2014 5:25 am    Post subject: Reply with quote

Apprentice

Joined: 18 Jul 2013
Posts: 26

fjb_saper wrote:
may be you need to put it into the background.

Try starting it as
Code:
nohup runmqdlq $1 $2 < $3
or
Code:
runmqdlq $1 $2 < $3 &



added & to the end of the .sh command and restarted

same results
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Apr 25, 2014 5:28 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

can you please show the output of DISPLAY SERVICE directly from runmqsc, rather than the mixed format you've shown.

the mixed format you've shown has single-quotes around several arguments, and I want to make sure that's not a display artifact.

that is, there's a significant difference between
Code:
/opt/mqm/bin/runmqdlq MQDBK02_DLQ MQDBK02 </var/mqm/qmgrs/MQDBK02/runmqdlq.rules
and
Code:
/opt/mqm/bin/runmqdlq 'MQDBK02_DLQ MQDBK02 </var/mqm/qmgrs/MQDBK02/runmqdlq.rules'
Back to top
View user's profile Send private message
exerk
PostPosted: Fri Apr 25, 2014 5:45 am    Post subject: Reply with quote

Jedi Council

Joined: 02 Nov 2006
Posts: 6339

OK, having finally managed to dig out an 'automated' DLQH set-up, I have the following:

Code:
STARTCMD('/<path>/mqdlqh.sh') +
STARTARG('DEAD.LETTER.QUEUE +QMNAME+ < /<path>/<rules_file_name>') +
STDOUT('/<path>/<stdout_file_name>') +
STDERR('/<path>/<stderr_file_name>') +
CONTROL(STARTONLY) +
SERVTYPE(SERVER)

And as mqjeff has stated, note the quotes...

The rules files contains the following:
Code:
* Start Control Data

RETRYINT(nn) WAIT(YES)

* End Control Data

* Start Rules

REASON(<MQRC>) ACTION(FWD) FWDQ(<QUEUE_NAME>)
REASON(<MQRC>) ACTION(RETRY) RETRY(n)

* End Rules

Obviously you'll need to substitute the desired <MQRC> and (n) values suitable for you.
_________________
It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys.
Back to top
View user's profile Send private message
cevans
PostPosted: Fri Apr 25, 2014 5:46 am    Post subject: Reply with quote

Apprentice

Joined: 18 Jul 2013
Posts: 26

mqjeff wrote:
can you please show the output of DISPLAY SERVICE directly from runmqsc, rather than the mixed format you've shown.

the mixed format you've shown has single-quotes around several arguments, and I want to make sure that's not a display artifact.

that is, there's a significant difference between
Code:
/opt/mqm/bin/runmqdlq MQDBK02_DLQ MQDBK02 </var/mqm/qmgrs/MQDBK02/runmqdlq.rules
and
Code:
/opt/mqm/bin/runmqdlq 'MQDBK02_DLQ MQDBK02 </var/mqm/qmgrs/MQDBK02/runmqdlq.rules'


In the version where I specify the startargs there is no service definition listed ??? The startargs are indeed within single quotes.

In the version where I run a script that contains the runmqdlq and parameters the service is as follows.
AMQ8629: Display service information details.
SERVICE(DLQHANDLER) CONTROL(MANUAL)
SERVTYPE(SERVER)
STARTCMD(/var/mqm/qmgrs/IB9QMGR/dlqhandler.sh)
STARTARG( ) STOPCMD( )
STOPARG( )
STDOUT(/var/mqm/log/IB9QMGR/dlqhandler.log)
STDERR(/var/mqm/log/IB9QMGR/dlqhandler.err)
DESCR(DLQ Handler) ALTDATE(2014-04-25)
ALTTIME(12.56.33)

Thanks
Back to top
View user's profile Send private message
cevans
PostPosted: Fri Apr 25, 2014 5:52 am    Post subject: Reply with quote

Apprentice

Joined: 18 Jul 2013
Posts: 26

exerk wrote:
OK, having finally managed to dig out an 'automated' DLQH set-up, I have the following:

Code:
STARTCMD('/<path>/mqdlqh.sh') +
STARTARG('DEAD.LETTER.QUEUE +QMNAME+ < /<path>/<rules_file_name>') +
STDOUT('/<path>/<stdout_file_name>') +
STDERR('/<path>/<stderr_file_name>') +
CONTROL(STARTONLY) +
SERVTYPE(SERVER)

And as mqjeff has stated, note the quotes...

The rules files contains the following:
Code:
* Start Control Data

RETRYINT(nn) WAIT(YES)

* End Control Data

* Start Rules

REASON(<MQRC>) ACTION(FWD) FWDQ(<QUEUE_NAME>)
REASON(<MQRC>) ACTION(RETRY) RETRY(n)

* End Rules

Obviously you'll need to substitute the desired <MQRC> and (n) values suitable for you.


Interesting ... What is in your mqdlqh.sh script?

I ask as you are still have STARTARGS which appears to have 4 parameters as defined.

Thanks
Back to top
View user's profile Send private message
exerk
PostPosted: Fri Apr 25, 2014 6:03 am    Post subject: Reply with quote

Jedi Council

Joined: 02 Nov 2006
Posts: 6339

Sorry, bad me, I put a space after the <

As for the script:
Code:
runmqdlq $1 $2 $3

_________________
It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Apr 25, 2014 6:04 am    Post subject: Reply with quote

Grand High Poobah

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

You say the service promptly ends...
Just as a double check: Is your DLQ get enabled?? (alias + underlying queue if you are using an alias)
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
tczielke
PostPosted: Sat Apr 26, 2014 3:14 am    Post subject: Reply with quote

Guardian

Joined: 08 Jul 2010
Posts: 941
Location: Illinois, USA

The following may be helpful in debugging why your runmqdlq service is not working.

1. Turn on a strmqtrc like follows:

strmqtrc -m qmgr -t all -p amqzmgr0,runmqdlq

2. Recreate your runmqdlq service being invoked.

3. Turn off the trace:

endmqtrc -a

4. Format your trace

cd /var/mqm/trace (if this is your trace directory)
dspmqtrc *

5. Search for runmqdlq in the amqzmgr0 trace. It should show you what inputs where used to start the runmqdlq program. Verify if this looks right.

6. Search in the runmqdlq trace for the AMQ8758 error or your trace input file to see if there are more details on why this AMQ8758 is being issued.
Back to top
View user's profile Send private message
cevans
PostPosted: Sun Apr 27, 2014 11:43 pm    Post subject: Reply with quote

Apprentice

Joined: 18 Jul 2013
Posts: 26

fjb_saper wrote:
You say the service promptly ends...
Just as a double check: Is your DLQ get enabled?? (alias + underlying queue if you are using an alias)


The DLQ is a local queue and it is both get & put enabled.

I can run the dlq handler without any problem if initiated from the command prompt. It is when I attempt to run as a service that I have problems.

Thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2, 3  Next Page 1 of 3

MQSeries.net Forum Index » IBM MQ Installation/Configuration Support » runmqdlq service on linux
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.