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 » runmqtrm started on prompt vs. started by the qmgr

Post new topic  Reply to topic
 runmqtrm started on prompt vs. started by the qmgr « View previous topic :: View next topic » 
Author Message
HenriqueS
PostPosted: Thu Feb 25, 2010 10:47 am    Post subject: runmqtrm started on prompt vs. started by the qmgr Reply with quote

Master

Joined: 22 Sep 2006
Posts: 235

Folks,

I have the following situation here:

1) If I start the trigger monitor through the command line, the defined Process object will run OK when the queue receives a message. The Process points to the script below:

Code:

#!/bin/bash
num=$RANDOM
whoami > /tmp/who.txt
/usr/bin/sudo /opt/mqm/samp/bin/amqsget QL.MQSC QM.SBCDF596 > /tmp/mqsc.$num.txt


2) But if I define a SERVICE to start the trigger monitor and start it trough MQ, the script will run somehow, but wont complete. I noticed this because the mqsc.$num.txt file is created but with 0 bytes.

File 'who.txt' in both cases gives 'root'.

DEFINE for the RUNMQTRM2 service:
Code:

display service(runmqtrm2)
     1 : display service(runmqtrm2)
AMQ8629: Display service information details.
   SERVICE(RUNMQTRM2)                      CONTROL(QMGR)
   SERVTYPE(SERVER)                        STARTCMD(/opt/mqm/bin/runmqtrm)
   STARTARG(-m QM.SBCDF596 -q FILA.PARA.MQSC)
   STOPCMD( )                              STOPARG( )
   STDOUT( )                               STDERR( )
   DESCR(Trigger Monitor da QL.MQSC)       ALTDATE(2010-02-25)
   ALTTIME(15.06.25)                   


Any idea of what is going on?
Back to top
View user's profile Send private message
HenriqueS
PostPosted: Tue Mar 02, 2010 1:59 pm    Post subject: Re: runmqtrm started on prompt vs. started by the qmgr Reply with quote

Master

Joined: 22 Sep 2006
Posts: 235

Solved,

I directed the Standard Error output to a file (ALTER SERVICE(...) STDERR(/tmp/+MQ_SERVICE_NAME+.err)) and got the following:

Code:

sudo: sorry, you must have a tty to run sudo
sudo: sorry, you must have a tty to run sudo


So I realized that my script.sh file had sudoed commands and WMQ runs the script without a terminal attached to it. Since the script did already run as root, the sudo util was not necessary, so I ripped it off and it is everything normal right now.
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 » runmqtrm started on prompt vs. started by the qmgr
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.