cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Application Online with correct environment variables

jani
Level 3

Hello,

I'm running Veritas Storage Foundation Cluster 5.0 on HP-UX 11.23. I'm using veritas to start application using Application agent. My script is executed as normal user (not root) and the script starts another java application. Problem is that when I start it from veritas it does not get all the correct environment variables. I can see that the command in online script is su - <user> -c <script>. When I login using the user script works just fine. Also if I execute it as root using su <user> -c script works.
My question is that what is the user when veritas start to execute online script? Also I'd like to know is it possible to execute that script without su command because that seems to cause problems in environment variables.

br, JP


****EDIT******

Post moved to Cluster Server Forum by Marianne van den Berg
1 ACCEPTED SOLUTION

Accepted Solutions

Gaurav_S
Moderator
Moderator
   VIP    Certified

Hi Jani,

As per my knowledge VCS has to run all the scripts as root thats why it does an su ... so this is as per design... however some agents like Oracle for example provide facility to give other username....

What I can suggest you however is, you can define your variables in  /opt/VRTSvcs/bin/vcsenv  file. This file is being read by VCS at the time of hastart & variable values are populated.

I believe this should help...


Gaurav

View solution in original post

3 REPLIES 3

Gaurav_S
Moderator
Moderator
   VIP    Certified

Hi Jani,

As per my knowledge VCS has to run all the scripts as root thats why it does an su ... so this is as per design... however some agents like Oracle for example provide facility to give other username....

What I can suggest you however is, you can define your variables in  /opt/VRTSvcs/bin/vcsenv  file. This file is being read by VCS at the time of hastart & variable values are populated.

I believe this should help...


Gaurav

jani
Level 3

Hi,

Thanks for the information. I will test this.

br, Jani

Marianne
Moderator
Moderator
Partner    VIP    Accredited Certified
Try to specify the User attribute instead of  'su - user' in script.

Extract from Budled Agents Guide:

An application runs in the default context of root. Specify the user name to run an application in a user context.

Under Optional Attributes for Application agent, see the 'User' attribute:

The user ID for running StartProgram, StopProgram, MonitorProgram, and CleanProgram. The processes specified in the MonitorProcesses list must run in the context of the specified user. Monitor checks the processes to make sure they run in this context.
Type and dimension: string-scalar
Default: root