From 80acac0c4b708e1470216eb7e881ea9a8e32c052 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Sun, 15 Jan 2012 04:42:35 +0100 Subject: [PATCH] dispvm: sleep as long as there is any disk activity (#82) --- vm_conf_files/dispvm-prerun.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/vm_conf_files/dispvm-prerun.sh b/vm_conf_files/dispvm-prerun.sh index 2cc5354..c0453f2 100755 --- a/vm_conf_files/dispvm-prerun.sh +++ b/vm_conf_files/dispvm-prerun.sh @@ -10,7 +10,15 @@ for app in $apps ; do done echo "Sleeping..." -sleep 60 +PREV_IO=0 +while true; do + IO=`vmstat -D | awk '/read|write/ {IOs+=$1} END {print IOs}'` + if [ $IO -lt $[ $PREV_IO + 50 ] ]; then + break; + fi + PREV_IO=$IO + sleep 1 +done ps ax > /tmp/dispvm-prerun-proclist.log