/usr/share/pegasus/sh/pegasus-lite-local.sh is in pegasus-wms 4.0.1+dfsg-8.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | #!/bin/bash
##
# Copyright 2007-2011 University Of Southern California
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
#
#
# This is a launcher script for pegasus lite local jobs
#
# Author: Karan Vahi <vahi@isi.edu>
# Author: Mats Rynge <rynge@isi.edu>
#
set -e
check_predefined_variables() {
#purpose: checks for variables that need to be predefined.
# The variables are PEGASUS_SUBMIT_DIR and JOBSTATE_LOG
if [ "X${_CONDOR_SCRATCH_DIR}" = "X" ]; then
echo "ERROR: _CONDOR_SCRATCH_DIR was not set" 1>&2
exit 1
fi
}
check_predefined_variables
dir=$_CONDOR_SCRATCH_DIR
if [ "${_PEGASUS_EXECUTE_IN_INITIAL_DIR}" = "true" ];then
dir=$_PEGASUS_INITIAL_DIR
fi
#sanity check on arguments
if [ $# -lt 1 ] ; then
echo "pegasus-lite-local requires path to executable followed by arguments";
exit 1
fi
executable=$1
cd $dir
shift
args=$@
#transfer any input files if required
if [ "X${_PEGASUS_TRANSFER_INPUT_FILES}" != "X" ]; then
#split files on ,
IFS=, read -a FILES <<< "$_PEGASUS_TRANSFER_INPUT_FILES"
for file in "${FILES[@]}";do
#echo "FILES NEED TO BE TRANSFERRED $file"
if [[ $file == /* ]] ; then
#file starts with /
cp $file $dir
else
#file is relative grab from initialdir
#check for initialdir
if [ "X${_PEGASUS_INITIAL_DIR}" = "X" ]; then
echo "ERROR: _PEGASUS_INITIAL_DIR not populated" 1>&2
exit 1;
fi
file=$_PEGASUS_INITIAL_DIR/$file
cp $file $dir
fi
done
fi
#execute the executable with the args
if [ "X${_PEGASUS_CONNECT_STDIN}" = "X" ]; then
#dont connect stdin
$executable "$@"
else
#cat is used to connect the stdin
cat - | $executable "$@"
fi
# transfer any output files back to the Pegasus initial dir
if [ "X${_PEGASUS_TRANSFER_OUTPUT_FILES}" != "X" ]; then
#check for initialdir
if [ "X${_PEGASUS_INITIAL_DIR}" = "X" ]; then
echo "ERROR: _PEGASUS_INITIAL_DIR not populated" 1>&2
exit 1;
fi
outputdir=$_PEGASUS_INITIAL_DIR
#split files on ,
IFS=, read -a FILES <<< "$_PEGASUS_TRANSFER_OUTPUT_FILES"
for file in "${FILES[@]}";do
#echo "FILES NEED TO BE TRANSFERRED $file"
cp $file $outputdir
done
fi
|