From 3e0b39fcc67a82576c83f4e38b745f5232a20b52 Mon Sep 17 00:00:00 2001 From: chb Date: Wed, 15 Aug 2012 13:24:31 +0000 Subject: [PATCH] use fiws* hosts only when idle git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1495 8c4709b5-6ec9-48aa-a5cd-a96041d1645a --- scripts/client.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/scripts/client.sh b/scripts/client.sh index 1c654572..a470921a 100755 --- a/scripts/client.sh +++ b/scripts/client.sh @@ -18,6 +18,30 @@ fi while [ ! -e stop ] do + # fiws fairness (don't use this host while someone else is logged in) + # since these pool computers are used by students + # NOTE: this will only work if fail-client terminates from time to time + # TODO: only on Mo-Fr/20h-6h and Sa-So/24h ? + if [[ $(uname -n) == fiws[1-2][0-9][0-9] ]]; then + FIWS_FREE=0 + while [ "$FIWS_FREE" -eq 0 ]; do + if [ -e stop ]; then + #repeated exit condition from above + exit 0 + fi + FIWS_FREE=1 + for user in $(users); do + if [[ "$user" != `whoami` ]]; then + # someone else uses this host, don't do any experiments + FIWS_FREE=0 + fi + done + if [ "$FIWS_FREE" -eq 0 ]; then + sleep 300 + fi + done + fi + #nice -n 19 ./bochs -q 2>&1 | tee log.$$.txt | fgrep Result #nice -n 18 ./bochs -q 2>&1 | fgrep Result nice -n 18 ./fail-client -q >/dev/null 2>&1