Subversion Repositories DevTools

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

#!/bin/bash
#
#   Wrapper script to start and restart the build tool
#   This script should be spawned by the init.d system
#
#   Killing abtD.jar will not stop the build system
#   as this script will respawn it
#
#   Best to kill the process group of this shell script
#
while true; do
    #
    #   Rotate logfiles for monitoring each session
    #   
    LOGFILE=/tmp/buildtool
    if [ -f $LOGFILE ] ; then
        for ii in 9 8 7 6 5 4 3 2 ; do
            last=$( expr $ii - 1 )
            [ -f $LOGFILE.$ii ]   && rm $LOGFILE.$ii
            [ -f $LOGFILE.$last ] && mv $LOGFILE.$last $LOGFILE.$ii
        done
        mv $LOGFILE $LOGFILE.1
    fi
    exec 2>$LOGFILE 1>&2

    #
    #   Launch the build tool
    #
    . /etc/profile
    unset GBE_PLATFORM
    echo $(date) Starting abtlaunch
    #jats vars -v
    jats -NoExportVars eprog /work/buildtool/abtlaunch
    echo $(date) abtlaunch stopped
    sleep 30
done