6d04ba603f
server. Error conditions are flagged by other processes by creating
a named dotfile in ${scratchdir}. If these files are found, report the
error status instead of the number of running jobs. Currently report "ERR"
for all error conditions; I will probably change this to a per-condition
message.
Currently only "squid not running" and "disk space low" conditions are
reported.
30 lines
528 B
Bash
Executable File
30 lines
528 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# This is run on the clients to report their loads to the server.
|
|
|
|
# configurable variables
|
|
pb=/var/portbuild
|
|
arch=$1
|
|
|
|
. ${pb}/${arch}/portbuild.conf
|
|
if [ -f ${pb}/${arch}/portbuild.$(hostname) ]; then
|
|
. ${pb}/${arch}/portbuild.$(hostname)
|
|
fi
|
|
|
|
# Look for exceptional conditions
|
|
error=0
|
|
for i in squid disk; do
|
|
if [ -f ${scratchdir}/.${i} ]; then
|
|
error=1
|
|
fi
|
|
done
|
|
|
|
if [ ${error} = 0 ]; then
|
|
num=$(echo $(ls -1d ${scratchdir}/*/chroot/*/used 2>/dev/null| wc -l))
|
|
else
|
|
num=ERR
|
|
fi
|
|
|
|
echo -n "$num "
|
|
uptime
|