fail*: only start a client if there is a reasonable amount of free memory
git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1578 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
@ -42,12 +42,19 @@ do
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#nice -n 19 ./bochs -q 2>&1 | tee log.$$.txt | fgrep Result
|
# only start a client if at least 500 MiB is available
|
||||||
#nice -n 18 ./bochs -q 2>&1 | fgrep Result
|
FREE_MEM=$(free -m | grep "buffers/cache:" | awk '{print $4}')
|
||||||
nice -n 18 ./fail-client -q >/dev/null 2>&1
|
if [ $FREE_MEM -lt "500" ]; then
|
||||||
if [ $? -eq 1 ]
|
# waiting for free memory. sleep 1-60s and retry.
|
||||||
then
|
sleep $(($RANDOM / (32768 / 60) + 1))
|
||||||
break
|
else
|
||||||
|
#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
|
||||||
|
if [ $? -eq 1 ]
|
||||||
|
then
|
||||||
|
break
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
echo DONE
|
echo DONE
|
||||||
|
|||||||
Reference in New Issue
Block a user