Merge launch and launch_local

This commit is contained in:
Némunaire 2015-01-18 04:24:29 +01:00 committed by Nemunaire
parent 23928993dc
commit 0405b1d2c4
3 changed files with 4 additions and 51 deletions

View File

@ -1,9 +1,3 @@
# The name of the frontend, like indicated in /etc/hosts
if [ -z "$FRONTEND_HOSTNAME" ]
then
export FRONTEND_HOSTNAME="phobos"
fi
# Username of the unpriviledge user that runs scripts
SYNCHRO_USER="synchro"

View File

@ -29,7 +29,10 @@ trap "kill $KP1 $KP2; rm -rf '$TMPF'; echo; kill $$" INT TERM
while ! [ -f /tmp/stop ];
do
./synchro.sh delete >> ./logs/synchro.log 2>&1
if [ -n "$FRONTEND_HOSTNAME" ]
then
./synchro.sh delete >> ./logs/synchro.log 2>&1
fi
if [ `ls submission | wc -l` -gt 1 ]
then

View File

@ -1,44 +0,0 @@
#!/bin/bash
# This script does all actions in backend local environment
rm -f /tmp/stop
cd `dirname "$0"`
. ./config.sh
if [ "$UID" = "0" ]
then
SCRIPT=`pwd`/`basename "$0"`
su -c "sh $SCRIPT" "$SYNCHRO_USER"
exit $?
fi
mkdir -p ./logs
touch ./logs/checks.log
tail -f ./logs/checks.log &
KP1=$!
TMPF=`mktemp`
tail -f "$TMPF" | ./gen_site.pl -d -T /dev/shm -s /tmp/scheduler.sock -bt /challenge/ -ba /challenge-admin/ -o ./out ERRORS HOME all DS &
KP2=$!
trap "kill $KP1 $KP2; rm -rf '$TMPF'; echo; kill $$" INT TERM
while ! [ -f /tmp/stop ];
do
if [ `ls submission | wc -l` -gt 1 ]
then
./clear_cache.sh top
./check.pl 2>> ./logs/checks.log >> "$TMPF"
else
sleep 1
fi
done
kill -9 $KP1 $KP2
rm -rf "$TMPF"