Video Screencast Help
Symantec to Separate Into Two Focused, Industry-Leading Technology Companies. Learn more.

Getting Application Online with correct environment variables

Created: 31 May 2010 • Updated: 01 Jul 2010 | 3 comments
This issue has been solved. See solution.

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

Comments 3 CommentsJump to latest comment

Gaurav Sangamnerkar's picture

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

PS: If you are happy with the answer provided, please mark the post as solution. You can do so by clicking link "Mark as Solution" below the answer provided.
 

SOLUTION
Marianne's picture

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

Supporting Storage Foundation and VCS on Unix and Windows as well as NetBackup on Unix and Windows
Handy NBU Links