summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorkris <kris@FreeBSD.org>2003-05-17 00:20:53 +0000
committerkris <kris@FreeBSD.org>2003-05-17 00:20:53 +0000
commit710464c00fe62f4c2685cfb5e2171a260429a4c2 (patch)
tree00d5371443329f57a0706763419590b01b51036e /Tools
parent0d9fd35a58d8e8c960a405de5ee29bd44b58dd6a (diff)
downloadFreeBSD-ports-710464c00fe62f4c2685cfb5e2171a260429a4c2.zip
FreeBSD-ports-710464c00fe62f4c2685cfb5e2171a260429a4c2.tar.gz
Switch to polling the clients with netcat to collect load stats, instead
of having the clients scp their loads to bento every 10 seconds. Fix some indentation and add some sleeps to make sure the startup script doesn't run too early in the boot process.
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/portbuild/scripts/checkmachines23
1 files changed, 10 insertions, 13 deletions
diff --git a/Tools/portbuild/scripts/checkmachines b/Tools/portbuild/scripts/checkmachines
index f11fdd4f..e675800 100755
--- a/Tools/portbuild/scripts/checkmachines
+++ b/Tools/portbuild/scripts/checkmachines
@@ -20,46 +20,43 @@ buildroot=/var/portbuild
arches=$*
+sleep 60
+
while true; do
for i in ${arches}; do
mlist=${buildroot}/${i}/mlist
- stamp=${buildroot}/${i}/loads/.stamp
unset DISPLAY
- touch ${stamp}
- sleep 15
min=99
set $(cat $mlist)
while [ $# -gt 1 ]; do
m=$1
l=$2
- if [ -f ${buildroot}/${i}/loads/$m -a \
- ! -z "$(find ${buildroot}/${i}/loads/$m -newer ${stamp})" ]; then
+ if (nc -w 5 $m infoseek > ${buildroot}/${i}/loads/$m < /dev/null); then
num=$(awk '{print $1}' ${buildroot}/${i}/loads/$m)
if [ "x$num" = "x" ]; then
# logger "checkmachines: file ${buildroot}/${i}/loads/$m is empty"
- num=99
+ num=99
fi
else
num=99
fi
- #xxx
- #xxx Need to figure out how this is happening and fix this script
- #xxx accordingly. This is what causes this script to go away on
- #xxx occasion.
- #xxx
- #xxx arith: syntax error: "7:53AM / 5"
- #xxx
+
num=$(($num / $l))
+
if [ $num -lt $min ]; then
mach=$m
min=$num
elif [ $num = $min ]; then
mach="$mach $m"
fi
+
shift 2
+
done
echo "$mach" > ${buildroot}/${i}/ulist
+
done
+ sleep 15
done
OpenPOWER on IntegriCloud