[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Condor-users] Custom Kill Signals and Condor



Hey,

I have a shell script that intercepts custom kill signals and performs commands (in my case, a VMWare suspend command) that can take up to a minute to complete before killing itself. When I issue a kill command in a second terminal, the script successfully calls the custom command and terminates. However, when I attempt to schedule the script through Condor, and attempt to remove the job, the script is not seeing a custom kill command. It seems that when we run the condor_rm command, Condor is killing the job either before it can run the custom command or it is not sending the correct custom kill signal.

Thanks,

Matt Baker
University of Arkansas


Below are the ClassAd and the shell script I am using:


ClassAd:
------------
Universe     	=	vanilla
Executable	=	vmstart.sh
Arguments	=	/home/mmb05/diskimage/other.vmx
KillSig		=	SIGUSR1
Log     		= 	vmware.log
Output      	= 	vmware.out
Error		= 	vmware.error
Queue

vmstart.sh
NOTE: This shell script starts a VMWare service checks every 30 sec to see if it has completed.
-------------
#!/bin/sh
/usr/bin/vmware-cmd $1 start

trap "/usr/bin/vmware-cmd $1 suspend hard; exit 0" SIGUSR1

i=0

while [ $i -le 0 ]
do
  j=`/usr/bin/vmrun list | grep $1 | wc -l`
  if [ $j -eq 0 ]; then
        i=1
  fi
  sleep 30
done