diff options
author | Kris Kennaway <kris@FreeBSD.org> | 2006-02-15 07:48:53 +0000 |
---|---|---|
committer | Kris Kennaway <kris@FreeBSD.org> | 2006-02-15 07:48:53 +0000 |
commit | 6d04ba603f158cff9df737525d4a62863d34e8ab (patch) | |
tree | 53735dcfa087d848c61faf2cb02e65a72107f75c /Tools | |
parent | Update to 0.3RC7. (diff) |
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.
Notes
Notes:
svn path=/head/; revision=156098
Diffstat (limited to 'Tools')
-rwxr-xr-x | Tools/portbuild/scripts/reportload | 15 |
1 files changed, 14 insertions, 1 deletions
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 |