#!/bin/bash if [ $# -ne 1 ] ; then echo "Usage: $0 machine" echo " Set the indicated WN to run Condor jobs" exit 1 fi setupDir=`dirname $0` if [ -e $setupDir/clusco_setup.sh ] ; then source $setupDir/clusco_setup.sh elif [[ "$clusCoDir" == "" ]] ; then echo "Abort: No clusco_setup file found" exit 2 fi mach=$1 # Need to strip off any domain extensions here for matching purposes # machine=`echo $mach | sed -e s/[.]/\ /g | awk '{print $1}'` line=`grep "${machine}\"" $clusCoDir/nodeinfo.csv` if [ $? -ne 0 ] ; then echo "Indicated $machine is not in the DB file" exit 3 fi echo "Attempting to turn on $machine to run Condor jobs." localMachine=$(python $clusCoCmd $machine NAME_PRIVATE) localNet=$(python $clusCoCmd $machine DOMAIN_PRIVATE) checkErr=`ssh -x root@${localMachine}.${localNet} /etc/check-fast.sh` if (( checkErr != 0 )) ; then echo " Error: machine fails check-fast with error code $checkErr" echo " Failure Result Summary:" ssh -x root@${localMachine}.${localNet} "grep ""Result\ was"" /tmp/check/checks.out |grep -v ""was\ 0""" echo " Condor will NOT be started." exit 1 fi ssh -x root@${localMachine}.${localNet} /sbin/service condor start if [ $? -ne 0 ] ; then echo " Error: could not start the condor service" exit 1 fi sleep 1 ssh -x root@${localMachine}.${localNet} condor_on if [ $? -ne 0 ] ; then echo " Error: could not set condor services running" exit 1 fi ${clusCoDir}/set_condor_state.sh $localMachine UP