/usr/share/arc/finish-condor-job is in nordugrid-arc-arex 1.1.1-1.
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 | #!/bin/sh
progname=$(basename "$0")
basedir=`dirname $0`
basedir=`cd $basedir > /dev/null && pwd` || exit $?
pkgdatadir="$basedir"
# This program assumes the role of /bin/mail, so it's called like this:
# /bin/mail -s '[Condor] Condor Job <job-ID>' <email-address>
# We extract the job-ID from the second argument.
#
# NOTE: The format of the email message is, unlike the job log, not guaranteed
# to remain unchanged in future versions of Condor, but since we need the job
# id to locate the log file, there's no way around this. :-(
lrmsid=${2##*Condor Job }
condorid=${lrmsid%% *}
lrmsid=${lrmsid%%.*}.condor
# Initialize environment for Condor commands!
. $pkgdatadir/configure-condor-env.sh || exit $?
# Set variable "controldir" from GM config.
controldir=$CONFIG_controldir
# Find the proper GRAMI file.
grami=$(find $controldir -name "job.[0-9][0-9]*.grami" \
| xargs grep -l "^joboption_jobid=${lrmsid}$")
gmlog=$controldir/$(basename "$grami" .grami).errors
# Then try in the .local file
if [ "x$grami" = "x" ]; then
local=$(find $controldir -name "job.[0-9][0-9]*.local" \
| xargs grep -l "^localid=${lrmsid}$")
gmlog=$controldir/$(basename "$local" .local).errors
# Fallback value. Collects the rest of the mails
if [ "x$local" = "x" ]; then
gmlog="$controldir/condor.mails"
fi
fi
# Logfile used by Grid Manager.
echo "$progname: ----- you got mail from Condor -----" >>"$gmlog"
echo "$progname: arg 0 $0" >>"$gmlog"
echo "$progname: arg 1 $1" >>"$gmlog"
echo "$progname: arg 2 $2" >>"$gmlog"
echo "$progname: arg 3 $3" >>"$gmlog"
TMPDIR=${TMPDIR:-/tmp}
mbody=$TMPDIR/mailbody.$$
# Dump mail body and Condor log into gmlog.
{
cat >$mbody || echo "$progname: failed to write $mbody"
echo "$progname: ----- begin condor job completion message -----"
sed "s/^/$progname: /" $mbody
echo "$progname: ----- end condor job completion message -----"
} >>"$gmlog" 2>&1
rm -f $mbody
|