I believe the compound command solution best fits my needs. One approach I had
tried was the shell script you mentioned but I am trying to avoid adding
dependencies, especially on the machines under test, if at all possible.
Thank you.
- Ryan
To: ex...@hotmail.com
CC: staf-users@lists.sourceforge.net
Subject: Re: [staf-users] Setting environmental variables from a shell script
From: luc...@us.ibm.com
Date: Wed, 22 Jun 2011 11:04:11 -0500
Each process started via STAF runs in the
environment that STAFProc is running in (plus any updates you've made to
environment variables via the ENV option(s), etc). and each process
runs in its own environment. Using a static handle does not change
this.
But, I thibk you can achieve what you
want by running a compound command that first sources the profile and then
runs your "appControl startServer" command (separating the two
commands using a semicolon, the Unix command separator), For example:
STAF local PROCESS START SHELL COMMAND
". /path/to/application/profile; appControl startServer" RETURNSTDOUT
STDERRTOSTDOUT WAIT
Or, you could create a shell script
that sources the profile and then runs your "appControl startServer"
command and run the shell script (as this would do essentially the same
thing).
--------------------------------------------------------------
Sharon Lucas
IBM Austin, luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313
From:
Ryan Zander <ex...@hotmail.com>
To:
<staf-users@lists.sourceforge.net>
Date:
06/22/2011 10:48 AM
Subject:
[staf-users]
Setting environmental variables from a shell script
Greetings,
I have some software installed on a Solaris 10 machine that I am trying
to start with a STAX job. In order to start the software you are
required to source a profile script first to setup the environment.
root# . /path/to/application/profileroot# appControl startServer
My first thought was to just build the environment by hand using the ENV
parameter of PROCESS START however I cannot depend on the environmental
variables always being the same. Also I would prefer to keep the logic
of building the environment in the shell script the application ships with.
I thought perhaps I could use a static handle to tie the processes together,
such as:
C:\> STAF solarisMachine PROCESS START SHELL COMMAND . PARMS
/path/to/application/profile
STATICHANDLENAME appEnvironment
Response-----------393
C:\> STAF solarisMachine PROCESS START SHELL COMMAND appControl
PARMS startServer ENV STAF_STATIC_HANDLE=393 WAIT RETURNSTDERR
Response--------{ Return Code: 1 Key :
<None> Files : [ {
Return Code: 0 Data : sh:
appControl: not found
} ]}
I can tell the environmental variables did not persist between processes
as the PATH appears to be incomplete. This leads me to believe I am
misunderstanding
the concept of static handles.
Any thoughts on how I could solve this problem?
- Ryan
------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is
safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today.
http://p.sf.net/sfu/quest-sfdev2dev
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users
------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today.
http://p.sf.net/sfu/quest-sfdev2dev
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users