diff --git a/deploy/restartComponent.sh b/deploy/restartComponent.sh index f722df690a..efd4e8ae49 100755 --- a/deploy/restartComponent.sh +++ b/deploy/restartComponent.sh @@ -13,8 +13,8 @@ DEST_NAME=cms-wmcore-team [[ -z $WMA_INSTALL_DIR ]] && { echo "ERROR: Trying to run without having the full WMAgent environment set!"; exit 1 ;} echo -e "\n###Checking agent logs at: $(date)" -comps=$(ls $WMA_INSTALL_DIR) -for comp in $comps; do +compsRunning=$(manage execute-agent wmcoreD --status |grep -E "Running:[0-9]+" |awk '{print $1}' |awk -F \: '{print $2}') +for comp in $compsRunning; do COMPLOG=$WMA_INSTALL_DIR/$comp/ComponentLog if [ ! -f $COMPLOG ]; then echo "Not a component or $COMPLOG does not exist"