26 lines
686 B
Bash
26 lines
686 B
Bash
|
#!/usr/bin/ksh
|
||
|
# $Id: suspend.sh 365 2013-11-18 09:58:17Z kasper $
|
||
|
# This script should be added as the SUSPEND_METHOD in the
|
||
|
# queue definition with a $job_pid, $job_id, and $job_owner arguments.
|
||
|
# e.g. script.sh $job_pid $job_id $job_owner
|
||
|
|
||
|
if [ -z "$3" ]
|
||
|
then
|
||
|
echo "Usage: $0 \$job_pid \$job_id \$job_owner"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
stat=`pgrep -g $1`
|
||
|
if [ ! -z "$stat" ]
|
||
|
then
|
||
|
#echo "Sending $sig to $1" >> ~$3/qdel_log.log
|
||
|
/usr/bin/pkill --signal SIGTSTP -g $1
|
||
|
else
|
||
|
echo "Process $1 not found for job $2" >> ~$3/qdel_log.log
|
||
|
echo "Unable to suspend." >> ~$3/qdel_log.log
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
#uncomment the following for debugging
|
||
|
#echo "Suspending Job $2 " >> ~$3/qdel_log.log
|