Legion 1.2
System Administrator Manual

4.0 Preparing the Legion environment

A properly set-up environment is crucial for working in the Legion system. The start-up process uses certain Legion-specific environment variables, which must be correctly set before starting applications and running command-line utility programs. Users must set these variables each time they enter Legion. Without a properly set environment, programs cannot communicate with other objects in the system, and the program may terminate with an error, never return a value, or fail in a more spectacular fashion. If this occurs, try setting your environment properly and starting over.

To prepare the environment in a newly started or restarted system, set the $LEGION and $LEGION_OPR variables and source the script that is appropriate for your shell.1

(ksh or sh users)

export LEGION=<Legion root dir path>
export LEGION_OPR=<Legion OPR root dir path> 

(csh users)

setenv LEGION <Legion root dir path>
setenv LEGION_OPR <Legion OPR root dir path>

Check to be sure that environment variables are properly set. If necessary, run:

(ksh or sh users)

. $LEGION/bin/legion_env.sh
. $LEGION_OPR/legion_context_env.sh

(csh users)

 source $LEGION/bin/legion_env.csh
source $LEGION_OPR/legion_context_env.csh

For the OPR root directory path, $LEGION/../OPR is suggested.

The environment must be properly set in each shell in which you plan to run Legion commands. We suggest that Legion system administrators prepare a set-up script for users to source when starting work in Legion. A sample script (setup.sh for uvanet) is shown below.

# source this file to setup your legion vars

export LEGION=/home/uvanet/Legion
export LEGION_OPR=$HOME/uvanet-OPR

mkdir -p $LEGION_OPR
cp -f $TEMP_OPR/LegionClass.config $LEGION_OPR
cp -f $TEMP_OPR/LegionClass.config._LegionStorage_MetaData_ $LEGION_OPR
cp -f $TEMP_OPR/legion_context_env.csh $LEGION_OPR
cp -f $TEMP_OPR/legion_context_env.sh $LEGION_OPR

if [ -f $LEGION/bin/legion_env.sh ]; then
   . $LEGION/bin/legion_env.sh
   echo legion_env.sh not found, cannot continue.

if [ -f $LEGION_OPR/legion_context_env.sh ]; then
   . $LEGION_OPR/legion_context_env.sh
   echo legion_context_env.sh not found, cannot continue.

1. Bourne Shell is not directly supported by our implementation of Legion, due to the use of alias to implement some Legion commands (notably legion_set_context). Bash, however, is supported. Back

Back to Installing and Running Legion sectional index

Back to System Administrator Manual Table of Contents