/usr/share/arc/cancel-gridfactory-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 63 64 65 66 67 68 69 70 71 72 73 | #!/bin/sh
# set -x
#
# Cancel job running in gridfactory.
#
echo "----- starting cancel_gridfactory_job -----" 1>&2
joboption_lrms=gridfactory
# ARC1 passes first the config file.
if [ "$1" = "--config" ]; then shift; ARC_CONFIG=$1; shift; fi
basedir=`dirname $0`
basedir=`cd $basedir > /dev/null && pwd` || exit $?
pkgdatadir="$basedir"
. ${pkgdatadir}/cancel_common.sh || exit $?
if [ -z "$joboption_controldir" ] ; then
joboption_controldir=`dirname "$arg_file"`
if [ "$joboption_controldir" = '.' ] ; then
joboption_controldir="$PWD"
fi
fi
job_control_dir="$joboption_controldir"
if [ -z "$joboption_gridid" ] ; then
joboption_gridid=`basename "$arg_file" | sed 's/^job\.\(.*\)\.grami$/\1/'`
fi
echo "Deleting job $joboption_gridid, local id $joboption_jobid" 1>&2
if [ -z "$joboption_jobid" ] ; then
joboption_jobid=`cat "$job_control_dir/job.${joboption_gridid}.local" | grep '^localid=' | sed 's/^localid=//'`
fi
case X`cat "$job_control_dir/processing/job.${joboption_gridid}.status"` in
XINLRMS)
$debug `su -c "$PSTAT $joboption_jobid" - $joboption_user|sed 's,$joboption_jobid ,,'`
case `su -c "$PSTAT $joboption_jobid" - $joboption_user|sed 's,$joboption_jobid ,,'` in
ready | requested | prepared | submitted )
su -c "$PCLEAN $joboption_jobid" - $joboption_user
;;
running | paused )
su -c "$PKILL $joboption_jobid" - $joboption_user
;;
executed |uploaded | requestKill | aborted | failed | done)
echo "Job already died, won't do anything" 1>&2
;;
*)
echo "Job is at unkillable state" 1>&2
exit 1
;;
esac
;;
XFINISHED | XDELETED)
echo "Job already died, won't do anything" 1>&2
;;
*)
echo "Job is at unkillable state" 1>&2
;;
esac
echo "----- exiting cancel_gridfactory_job -----" 1>&2
echo "" 1>&2
exit 0
|