Admin/isatest/isatest-settings
author kleing
Thu Oct 09 09:18:32 2008 +0200 (2008-10-09)
changeset 28539 bdb308737bfd
parent 24782 38e5c05ef741
child 28567 3caee0cd91d8
permissions -rw-r--r--
do logging to MASTERLOG centrally (avoid multiple writers over NFS as
this tends to corrupt the log file if not mounted with -sync option
which apparently is not the default any more).
kleing@22410
     1
# -*- shell-script -*-
kleing@22410
     2
# $Id$
kleing@22410
     3
# Author: Gerwin Klein, NICTA
kleing@22410
     4
#
kleing@22410
     5
# DESCRIPTION: common settings for the isatest-* scripts
kleing@22410
     6
kleing@22410
     7
# source bashrc, we're called by cron
kleing@22410
     8
. ~/.bashrc
kleing@22410
     9
kleing@22410
    10
# canoncical home for all platforms
kleing@22410
    11
HOME=/home/isatest
kleing@22410
    12
kleing@22410
    13
## send email on failure to
isatest@24782
    14
MAILTO="kleing@cse.unsw.edu.au nipkow@in.tum.de berghofe@in.tum.de schirmer@in.tum.de lp15@cam.ac.uk makarius@sketis.net haftmann@in.tum.de krauss@in.tum.de"
kleing@22410
    15
kleing@22410
    16
LOGPREFIX=$HOME/log
kleing@22410
    17
MASTERLOG=$LOGPREFIX/isatest.log
kleing@28539
    18
LOGSERVER=macbroy23.informatik.tu-muenchen.de
kleing@22410
    19
kleing@22410
    20
ERRORDIR=$HOME/var
kleing@22410
    21
ERRORLOG=$ERRORDIR/error.log
kleing@22410
    22
kleing@22410
    23
RUNNING=$HOME/var/running
kleing@22410
    24
kleing@22410
    25
DISTPREFIX=$HOME/tmp/isadist
kleing@28539
    26
kleing@28539
    27
# this function avoids NFS inconsistencies with multiple writers by
kleing@28539
    28
# sshing to one central machine and writing locally. There is stil a
kleing@28539
    29
# race condition, but at least it should not corrupt a whole set of entries
kleing@28539
    30
# any more.
kleing@28539
    31
function log()
kleing@28539
    32
{
kleing@28539
    33
  MSG="$1"
kleing@28539
    34
  TIMESTAMP="$(date)"
kleing@28539
    35
  echo "[$TIMESTAMP $HOSTNAME $PRG]: $MSG" | ssh $LOGSERVER "cat >> $MASTERLOG"
kleing@28539
    36
}