freebsd-ports/Tools/portbuild/scripts/reportload
Mark Linimon ae733423e0 Generalize the packge building scripts to be able to be run on more than
one 'head' node, rather than just pointyhat itself.

Constants are factored out into installation-specific files known as
portbuild/conf/server.conf and portbuild/conf/client.conf.  There is
only one server.conf file.  Individual <arch> directories may have
their own client.conf files, or may symlink to ../conf/client.conf.

This first set of files only gets the *.conf files and some cleanup.

Feature safe:	yes
2010-06-25 22:49:56 +00:00

41 lines
886 B
Bash
Executable file

#!/bin/sh
# $FreeBSD$
# client script to report load to the server.
pb=/var/portbuild
# note: uname is not being overridden
arch=$(uname -m)
osver=$(sysctl -n kern.osreldate)
. ${pb}/${arch}/client.conf
. ${pb}/${arch}/portbuild.conf
if [ -f ${pb}/${arch}/portbuild.$(hostname) ]; then
. ${pb}/${arch}/portbuild.$(hostname)
fi
# Look for exceptional conditions
error=
for i in squid disk; do
if [ -f ${scratchdir}/.${i} ]; then
error="${i} ${error}"
fi
done
num=$(echo $(ls -1d ${scratchdir}/*/*/*/used ${scratchdir}/*/*/chroot/*/used 2>/dev/null| wc -l))
echo "arch=${arch}"
echo "osversion=${osver}"
echo "jobs=${num}"
cd /var/portbuild/${arch}
for i in */builds/*; do
buildenv=${arch}/${i%%/*}/${i##*/}
if [ -f ${i}/.ready ]; then
buildenvs="${buildenv} ${buildenvs}"
fi
done
echo "buildenvs=${buildenvs}"
echo -n "load="
uptime
echo "error=${error}"