From 2b8e63c45178063d94a99d79af4394675f9beb91 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 21 Jun 2013 15:01:46 -0700 Subject: [PATCH] Add driver/run.sh since this is fairly useful. --- README | 8 +++++++- driver/run.sh | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100755 driver/run.sh diff --git a/README b/README index eee6dcc..2d22c22 100644 --- a/README +++ b/README @@ -39,7 +39,13 @@ Setting up (3): (a) Add a database entry for the machine configuration. (b) Edit awfy.config to match the build architecture you want, and machine database entry. - (c) Add a cronjob to run dostuff.py periodically. AWFY.com runs every 30min. + (c) Run dostuff.py periodically - Mozilla uses "run.sh" which will run + continuously, since a cronjob could run overlapping jobs. + + # Note, interrupting dostuff.py can cause problems with subversion, for + # example, the WebKit repository may become stuck and need an svn cleanup + # or an rm -rf and clean checkout. For sanity, run.sh will pause its next + # run if it sees a /tmp/awfy lock in place, and this can be used to wait. # Note It is not safe to share multiple AWFY instances from the same # repository, since C++ object files are generally re-used and may diff --git a/driver/run.sh b/driver/run.sh new file mode 100755 index 0000000..ee634b0 --- /dev/null +++ b/driver/run.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +# Protocol for stopping AWFY: +# +# (1) If you want to stop it immediately: +# screen -r +# ctrl+c +# rm /tmp/awfy-daemon +# rm /tmp/awfy +# ctrl a+d +# Remember to start it again later! +# +# (2) If you want to it to stop when possible: +# touch /tmp/awfy +# screen -r +# (wait for it to confirm that it's no longer running) +# ctrl a+d + +PATH=/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin +if [ -e /tmp/awfy-daemon ] +then + echo "Already running" + exit 0 +fi + +touch /tmp/awfy-daemon +while : +do + if [ -e /tmp/awfy ] + then + echo "/tmp/awfy lock in place" + sleep 10 + else + cd /Users/mozilla/awfy/ia32/driver + python dostuff.py --config=awfy-x86.config + cd /Users/mozilla/awfy/x64/driver + python dostuff.py --config=awfy-x64.config + fi +done +rm /tmp/awfy-daemon +