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 IBM MQ Support » MQCONN ignores MQSERVER when application run as a cron job

Post new topic  Reply to topic
 MQCONN ignores MQSERVER when application run as a cron job « View previous topic :: View next topic » 
Author Message
amacygnus
PostPosted: Mon Mar 14, 2011 3:16 am    Post subject: MQCONN ignores MQSERVER when application run as a cron job Reply with quote

Newbie

Joined: 14 Mar 2011
Posts: 1

Hi everyone,

I've got a MQ application written in C/C++ and I need it to run on a linux server at frequent intervals.

I've set up a MQSERVER env. variable which is picked up by the application when started. It runs, gets the messages and finishes.

The problem occurs when I specify the application to be run as a cron job, when it executes it fails with 2058 and the error log contains the following message:

"AMQ9518: File '/var/mqm/AMQCLCHL.TAB' not found.

EXPLANATION:
The program requires that the file '/var/mqm/AMQCLCHL.TAB' is present and
available.
ACTION:
This may be caused by invalid values for the optional environment variables
MQCHLLIB, MQCHLTAB or MQDATA. If these variables are valid or not set then
record the name of the file and tell the systems administrator who must ensure
that file '/var/mqm/AMQCLCHL.TAB' is available to the program.
"

As far as I know the TAB file shouldn't be picked up if MQSERVER is defined, i.e. it takes priority over it.
What could be the problem? Starting the app manually it does get MQSERVER but when started by cron it doesn't...

Any help would be much appreciated. Thanks.
Back to top
View user's profile Send private message
zpat
PostPosted: Mon Mar 14, 2011 3:58 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

Why not use a CCDT?

Personally I see MQSERVER as a temporary overide facility. The CCDT can help with load balancing, reconnection, SSL and and avoids each MQ application having its own reference to the queue manager host and port etc.

You could set MQSERVER in the application start script (coding one if necessary) rather than the userid profile. Check that it is exported. But embedded this in the app or user profile is not best practice.

Support Pac MO72 makes creating a CCDT (on any platform) easy.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Mar 14, 2011 4:11 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You can swap the use of MQSERVER for the use of the MQCLNT environment variables that point to a CCDT without change to the application, presumably.

The shell that a cron job runs under is NOT the same as the shell that a given user runs under when that user logs into an interactive session.

This is basic Unix sysadmin stuff - so ask your unix sysadmin.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Mon Mar 14, 2011 5:30 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

In answer to your specific question as to why the difference in behavior:

The MQSERVER environment variable is for a single instance of a shell. Create a shell script that sets (exports) the MQSERVER env variable before attempting to execute the application.
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
gbaddeley
PostPosted: Mon Mar 14, 2011 2:33 pm    Post subject: Reply with quote

Jedi Knight

Joined: 25 Mar 2003
Posts: 2538
Location: Melbourne, Australia

Quote:
The problem occurs when I specify the application to be run as a cron job,


Is the cron job running a script or the app program binary?

If its running a script, just export the variable in the script. If its an app binary, export the variable in the user's logon profile.
_________________
Glenn
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 IBM MQ Support » MQCONN ignores MQSERVER when application run as a cron job
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.