#!/bin/bash # # BonFIRE Virtual Clusters on Federated Clouds Demonstration Kit # # Copyright (c) Fundacion Centro Tecnologico de Supercomputacion de Galicia 2012 # # License GPL Version 3 # # The research leading to these results has received funding from # the European Community's Seventh Frameqork Programme (FP7/2007-2013) # under agreement number 257386 # # This software is provided with ABSOLUTELY NO WARRANTY # LOG="/var/log/killproc.log" touch $LOG while [[ True ]] do echo "-------" >> $LOG ps x | grep "python /mnt/lib/configureServer.py" | grep -v "grep" >> $LOG PID=`ps x | grep "python /mnt/lib/configureServer.py" | grep -v "grep" | awk {'print $1'}` if [[ $PID != "" ]] then echo "Trying to kill $PID" >> $LOG kill -9 $PID echo "Killed" >> $LOG exit else echo "Not found, sleeping" >> $LOG sleep 5 fi done