Blame | Last modification | View Log | RSS feed
# buildtool - Upstart job file for the VIX buildtooldescription "JATS Build Daemon"author "dpurdie"# When to start the servicestart on runlevel [2345]# When to stop the servicestop on runlevel [016]# Automatically restart process if crashedrespawn# Essentially lets upstart know the process will detach itself to the background#expect fork# Specify the usersetuid buildadmsetgid ccperdevenv USER=buildadmenv HOME=/home/buildadm# Start the process# Uses sh, not bash or anything fancy# Run with '-e' - exit immediately if any untested command failsscript# Rotate startup log filesLOGFILE=/tmp/buildtoolif [ -f $LOGFILE ] ; thenfor ii in 9 8 7 6 5 4 3 2 ; dolast=$( expr $ii - 1 )[ -f $LOGFILE.$ii ] && rm $LOGFILE.$ii[ -f $LOGFILE.$last ] && mv $LOGFILE.$last $LOGFILE.$iidonemv $LOGFILE $LOGFILE.1fiexec 2>$LOGFILE 1>&2echo $(date) ' -- Starting buildtool'. /etc/profileunset GBE_PLATFORM#jats vars -vjats -NoExportVars eprog /work/buildtool/abtlaunch || trueecho $(date) ' -- Sleep 30 seconds before restarting'sleep 30end script