GLExec Environment Wrap and Unwrap scripts

From PDP/Grid Wiki
Jump to navigationJump to search

GLExec Wrap and Unwrap environment variables describes how you can wrap environment variables (from a Pilot Job Framework) in such a way that they don't get wipe and unwrap them (safely) in the target account (Pilot Job Payload) process.

More (details) information can be found on the Need to Know's page.

Where to find packages and sources

The sources can be found in our SVN repository.

We provide a new package named glexec-wrapper-scripts, which is distributed as part of the glite-GLEXEC_wn (gLite 3.1 and gLite 3.2) and can also be found in the Etics repository.


gLExec wrapper scripts: and

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

Intended usage

export GLEXEC_ENV=``
/opt/glite/sbin/glexec -- <YOUR-COMMAND>

(Making) Exceptions

By default the following environment variables are NOT unwrapped:

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

This set of environment variables must kept relative to the active user account. The X509_USER_PROXY and the HOME variables are set explicitly to values that are appropriate to the mapped user account.

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

--exclude=A --exclude=B




Example 1:

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

Example 2:

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

Example 3:

export GLEXEC_ENV=` --exclude=MYVAR,FOO`
/opt/glite/sbin/glexec -- <YOUR-COMMAND>

Combined, easy to adopt, script:

We've combined the two Perl scripts and the gLExec call into a plain and simple shell script. This script is also packaged in the glexec-wrapper-scripts as the shell script: /opt/glite/sbin/


#cd ${GLITE_LOCATION:-/opt/glite}
export GLEXEC_ENV=`${0%/*}/`
exec ${GLITE_LOCATION:-/opt/glite}/sbin/glexec ${0%/*}/ -- $@


/opt/glite/sbin/ /usr/bin/id -a