Skip to content

Commit

Permalink
fixed script for shutting down servers
Browse files Browse the repository at this point in the history
  • Loading branch information
papousek committed May 1, 2013
1 parent a777823 commit 9f90126
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion benchmark/bench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
SELF=`readlink -f $0`
SELF_DIR=`dirname $SELF`
BENCHMARK_LIST_FILE=$1
set -x

if [ -z $BASH_EXEC ]; then
BASH_EXEC=/bin/sh
Expand Down Expand Up @@ -56,6 +57,7 @@ for LINE in `cat $BENCHMARK_LIST_FILE`; do

if [[ $CONFIG =~ .*dist.* ]]; then
echo "## stopping servers";
$BASH_EXEC $SELF_DIR/../servers-shutdown.sh $SELF_DIR/configs/$CONFIG.xml;
COMMAND="$BASH_EXEC $SELF_DIR/../servers-shutdown.sh $SELF_DIR/configs/$CONFIG.xml";
eval $COMMAND;
fi
done
5 changes: 3 additions & 2 deletions servers-shutdown.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
SELF=`readlink -f $0`
SELF_DIR=`dirname $SELF`
CONFIG_FILE=$1
set -x;

usage()
{
Expand All @@ -21,9 +22,9 @@ if [ "$CONFIG_FILE" == "" ]; then
fi

for IP in `grep "<value>" $CONFIG_FILE | tr '<>' ' ' | awk '{ print $2 }'`; do
PROCESSES=`ssh $IP -t "ps -ux | grep parasim" | awk '{print $2}'`
PROCESSES=`ssh $IP "ps -ux | grep parasim" | awk '{print $2}'`;
for PROCESS in $PROCESSES; do
ssh $IP -t "kill -9 $PROCESS"
ssh $IP "kill -9 $PROCESS";
done
echo "server $IP killed";
done

0 comments on commit 9f90126

Please sign in to comment.