Updated start script to startup celeryd

This commit is contained in:
2010-11-08 12:48:34 +00:00
parent 4df72a3c7f
commit 879329032a

View File

@@ -1,17 +1,27 @@
#!/bin/bash
ROOT=`pwd`
PIDFILE=$ROOT/logs/auth.pid
PIDROOT=$ROOT/logs
AUTH_PID_FILE="$PIDROOT/auth.pid"
CELERYD_PID_FILE="$PIDROOT/celeryd.pid"
mkdir logs 2> /dev/null
if [ -f $PIDFILE ]; then
kill `cat -- $PIDFILE` 2> /dev/null
rm -f -- $PIDFILE
if [ -f $AUTH_PID_FILE ]; then
kill `cat -- $AUTH_PID_FILE` 2> /dev/null
rm -f -- $AUTH_PID_FILE
fi
if [ -f $CELERYD_PID_FILE ]; then
kill `cat -- $CELERYD_PID_FILE` 2> /dev/null
rm -f -- $CELERYD_PID_FILE
fi
sleep 1
cd $ROOT
source ./env/bin/activate
./manage.py runfcgi daemonize=true pidfile=$PIDFILE host=127.0.0.1 port=9981 errlog=$ROOT/logs/stderr.log outlog=$ROOT/logs/stdout.log
./manage.py celeryd -B > $ROOT/logs/celeryd.lg 2>&1 &
./manage.py celeryd -B -E -l INFO --pidfile $CELERYD_PID_FILE > $ROOT/logs/celeryd.log 2>&1 &
./manage.py runfcgi daemonize=true pidfile=$AUTH_PID_FILE host=127.0.0.1 port=9981 errlog=$ROOT/logs/stderr.log outlog=$ROOT/logs/stdout.log