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 » Process startup location

Post new topic  Reply to topic Goto page 1, 2  Next
 Process startup location « View previous topic :: View next topic » 
Author Message
mattfarney
PostPosted: Tue May 03, 2011 4:54 pm    Post subject: Process startup location Reply with quote

Disciple

Joined: 17 Jan 2006
Posts: 167
Location: Ohio

Assume I have a triggerable process as defined below on HP-IA64. v6

Code:
define process(SOME_APP)
appltype(UNIX)
APPLICID(/home/auser/someapp)
envrdata(&)


What directory does it run from?
No clue. Couldn't find anything that even gave a hint.
This could matter for INI files as an example.


What user does it run under?
I'm guessing mqm.


Thanks
-mf
Back to top
View user's profile Send private message
bruce2359
PostPosted: Tue May 03, 2011 6:39 pm    Post subject: Re: Process startup location Reply with quote

Poobah

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

mattfarney wrote:
Assume I have a triggerable process as defined below on HP-IA64. v6

Code:
define process(SOME_APP)
appltype(UNIX)
APPLICID(/home/auser/someapp)
envrdata(&)


What directory does it run from?


The directory you specify in APPLICID.
_________________
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
skoobee
PostPosted: Tue May 03, 2011 10:14 pm    Post subject: Reply with quote

Acolyte

Joined: 26 Nov 2010
Posts: 52

[quote]What directory does it run from?[/quote]

/var/mqm? IBM does not say. It would be easy to tell by calling getcwd() from the app.
It woiuld not be wise to rely on the directory. As IBM do not specify the dir, it could be changed at any time. The safest thing to do would be to refer to all files in the triggered app by full path names.

[quote]What user does it run under?
[/quote]

It is mqm. runmqtrm is setuid/setgid mqm/mqm, and apps started by it inherit the user/group.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Wed May 04, 2011 6:30 am    Post subject: Reply with quote

Poobah

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

Quote:
What directory does it run from?


The application executes from whatever directory you specify in the APPLICID() attribute of the PROCESS definition. If the application is already in the executable filepath, then you need not specify the entire path.

Are you asking 'under what authority does the triggered application run?'

Are you asking 'under what authority does the trigger monitor run?'

Exactly what is your question?
_________________
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
mqjeff
PostPosted: Wed May 04, 2011 7:01 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Bruce - not quite sure if you are following the question or not.

The question is not "how does MQ find the program to launch". The question is "What is the current working directory set to when MQ launches the program".

The answer to this is not documented, at least that I recall (I haven't looked), and in general it should not be relied on. The app should use full paths or take steps to ensure that it is working from a known location when using relative paths.

Or the APPLICID should instead point to a shell script that does an explicit change directory before lanching the actual application...
Back to top
View user's profile Send private message
shashivarungupta
PostPosted: Wed May 04, 2011 7:31 am    Post subject: Reply with quote

Grand Master

Joined: 24 Feb 2009
Posts: 1343
Location: Floating in space on a round rock.

'Process startup location' is the subject given by OP and by that I can guess what he meant to say that the location from where process would be triggered.

DIS PROCESS(TRIGGERED_PROCESS) APPLICID

Sample Output:

AMQ8407: Display Process details.
PROCESS(TRIGGERED_PROCESS) APPLICID(/home/myuser/bin/mycmd)

(for more clarity you can check the 'Triggering Checklist' , in the post 'Facts of triggering' inside 'Links' forum section)


_________________
*Life will beat you down, you need to decide to fight back or leave it.
Back to top
View user's profile Send private message Send e-mail
bruce2359
PostPosted: Wed May 04, 2011 7:41 am    Post subject: Reply with quote

Poobah

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

mqjeff wrote:
Bruce - not quite sure if you are following the question or not.

The question is "What is the current working directory set to when MQ launches the program".

...the APPLICID should instead point to a shell script that does an explicit change directory before lanching the actual application...


Clearly, I did not understand the question. I have problems with the language, you know.
_________________
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
Vitor
PostPosted: Wed May 04, 2011 7:55 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

bruce2359 wrote:
I have problems with the language, you know.


You have problems? I look forward to the day I can use a drive-through to get fast food. Rather than park up, go inside and point at a picture.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed May 04, 2011 8:05 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

shashivarungupta wrote:
'Process startup location' is the subject given by OP and by that I can guess what he meant to say that the location from where process would be triggered.



But the text of the question was
mattfarney wrote:

What directory does it run from?
No clue. Couldn't find anything that even gave a hint.



And the answer, fundamentally, is "it depends entirely on what the trigger monitor application does". And it's not specified in the documentation on what runmqtrm/runmqtmc does, although it would not be unreasonable to assume that it would use the same system() call that amqstrg0.c does.

Which means that the new program would inherit the current working directory of the trigger monitor program. Which would depend on how the trigger monitor program was started....
Back to top
View user's profile Send private message
bruce2359
PostPosted: Wed May 04, 2011 8:15 am    Post subject: Reply with quote

Poobah

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

skoobee wrote:


It is mqm. runmqtrm is setuid/setgid mqm/mqm, and apps started by it inherit the user/group.


Must the supplied runmqtrm application be executed with authority of the mqm group?

Should triggered applications inherit mqm authority?
_________________
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
shashivarungupta
PostPosted: Wed May 04, 2011 8:54 am    Post subject: Reply with quote

Grand Master

Joined: 24 Feb 2009
Posts: 1343
Location: Floating in space on a round rock.

Vitor wrote:
bruce2359 wrote:
I have problems with the language, you know.

..I look forward to the day I can use a drive-through to get fast food. Rather than park up, go inside and point at a picture.


McDonalds does it for you. Taco Bell does it for you. isn't it !
_________________
*Life will beat you down, you need to decide to fight back or leave it.
Back to top
View user's profile Send private message Send e-mail
mattfarney
PostPosted: Wed May 04, 2011 8:58 am    Post subject: Reply with quote

Disciple

Joined: 17 Jan 2006
Posts: 167
Location: Ohio

mqjeff wrote:
And the answer, fundamentally, is "it depends entirely on what the trigger monitor application does". And it's not specified in the documentation on what runmqtrm/runmqtmc does, although it would not be unreasonable to assume that it would use the same system() call that amqstrg0.c does.

Which means that the new program would inherit the current working directory of the trigger monitor program. Which would depend on how the trigger monitor program was started....


So, assuming the monitor is being started as a service with something like
Code:
DEFINE SERVICE(TRIG_MON_START) +
       CONTROL(QMGR) +
       SERVTYPE(SERVER) +
       STARTCMD('runmqtrm') +
       STARTARG('-m someQM -q someInitQ')


it is likely that the runtime directory will be /var/mqm unless I do something specific to move it - but that could change since IBM hasn't published a real behavior for this.

-mf
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed May 04, 2011 9:11 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

shashivarungupta wrote:
Vitor wrote:
bruce2359 wrote:
I have problems with the language, you know.

..I look forward to the day I can use a drive-through to get fast food. Rather than park up, go inside and point at a picture.


McDonalds does it for you. Taco Bell does it for you. isn't it !


Yes, but alas, he's a foreigner in the vast American midwest, where they don't even understand other American accents.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed May 04, 2011 9:18 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

mqjeff wrote:
Yes, but alas, he's a foreigner in the vast American midwest, where they don't even understand other American accents.


With every intention of reinforcing a stereotype I'm not a foreigner - I'm British!

(pause for playing of national anthem)

I can however confirm that the midwest is vast, where the deer and the accents do play.

Apparently my family-in-law are buying me a red check shirt & baseball cap for my birthday. If this proves to be true ....
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
exerk
PostPosted: Wed May 04, 2011 11:17 pm    Post subject: Reply with quote

Jedi Council

Joined: 02 Nov 2006
Posts: 6339

Vitor wrote:
With every intention of reinforcing a stereotype I'm not a foreigner - I'm British!

Not English then?

The question is why they're buying you a baseball cap?
_________________
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
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » General IBM MQ Support » Process startup location
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.