From 6d04ba603f158cff9df737525d4a62863d34e8ab Mon Sep 17 00:00:00 2001 From: Kris Kennaway Date: Wed, 15 Feb 2006 07:48:53 +0000 Subject: Add a mechanism for reporting client machine error conditions back to the 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. --- Tools/portbuild/scripts/reportload | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'Tools') diff --git a/Tools/portbuild/scripts/reportload b/Tools/portbuild/scripts/reportload index 911b08fa38ff..42d5e72eaa80 100755 --- a/Tools/portbuild/scripts/reportload +++ b/Tools/portbuild/scripts/reportload @@ -11,6 +11,19 @@ if [ -f ${pb}/${arch}/portbuild.$(hostname) ]; then . ${pb}/${arch}/portbuild.$(hostname) fi -num=$(echo $(ls -1d ${scratchdir}/*/chroot/*/used 2>/dev/null| wc -l)) +# 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 -- cgit v1.2.3