Difference between revisions of "GLExec Environment Wrap and Unwrap scripts"

From PDP/Grid Wiki
Jump to navigationJump to search
Line 9: Line 9:
 
= gLExec wrapper scripts: glexec_wrapenv.pl and glexec_unwrapenv.pl) =
 
= gLExec wrapper scripts: glexec_wrapenv.pl and glexec_unwrapenv.pl) =
  
Helper script to restore the environment variables previously wrapped into the environment variable GLEXEC_ENV using the glexec_wrapenv.pl script.
+
Helper scripts to restore the environment variables previously wrapped into the environment variable GLEXEC_ENV using the glexec_wrapenv.pl script.
  
Intended usage:
+
= Intended usage =
 
  export GLEXEC_ENV=`glexec_wrapenv.pl`
 
  export GLEXEC_ENV=`glexec_wrapenv.pl`
 
  /opt/glite/sbin/glexec glexec_unwrapenv.pl -- <YOUR-COMMAND>
 
  /opt/glite/sbin/glexec glexec_unwrapenv.pl -- <YOUR-COMMAND>
  
 +
== Important details ==
 
By default the following environment variables are NOT unwrapped:
 
By default the following environment variables are NOT unwrapped:
 
* HOME  
 
* HOME  
Line 27: Line 28:
 
  --exclude=A,B,...
 
  --exclude=A,B,...
  
 +
== Examples ==
 
Example 1:
 
Example 1:
 
  export GLEXEC_ENV=`glexec_wrapenv.pl --exclude=MYVAR`
 
  export GLEXEC_ENV=`glexec_wrapenv.pl --exclude=MYVAR`

Revision as of 09:14, 10 June 2009

GLExec Wrap and Unwrap environment variables] describes how you can wrap environment variables in such a way that they don't get wipe and unwrap them (safely) in the target account (pilot job payload) process.

Where to find packages and sources

We provide a new packages named glexec-wrapper-scripts (at the moment primarily) through the Etics system.

The sources can be found in our SVN repository.

gLExec wrapper scripts: glexec_wrapenv.pl and glexec_unwrapenv.pl)

Helper scripts to restore the environment variables previously wrapped into the environment variable GLEXEC_ENV using the glexec_wrapenv.pl script.

Intended usage

export GLEXEC_ENV=`glexec_wrapenv.pl`
/opt/glite/sbin/glexec glexec_unwrapenv.pl -- <YOUR-COMMAND>

Important details

By default the following environment variables are NOT unwrapped:

  • HOME
  • LOGNAME
  • USER
  • X509_USER_PROXY
  • _ (yes that's '_' !)

A user can add more env vars to be excluded using either

--exclude=A --exclude=B

or

--exclude=A,B,...

Examples

Example 1:

export GLEXEC_ENV=`glexec_wrapenv.pl --exclude=MYVAR`
/opt/glite/sbin/glexec glexec_unwrapenv.pl -- <YOUR-COMMAND>

Example 2:

export GLEXEC_ENV=`glexec_wrapenv.pl`
/opt/glite/sbin/glexec glexec_unwrapenv.pl --exclude=MYVAR -- <YOUR-COMMAND>

Example 3:

export GLEXEC_ENV=`glexec_wrapenv.pl --exclude=MYVAR`
/opt/glite/sbin/glexec glexec_unwrapenv.pl -- <YOUR-COMMAND>