Updated start script to store err/out logs, also use daemon mode

This commit is contained in:
2010-10-28 10:58:26 +01:00
parent ea3f7e2783
commit 49470765ac
2 changed files with 9 additions and 4 deletions

2
fabfile.py vendored
View File

@@ -1,4 +1,5 @@
from __future__ import with_statement
import time
from fabric.api import *
env.repo = 'git://dev.dredd.it/dreddit-auth.git'
@@ -137,4 +138,5 @@ def restart():
Restart the FCGI server
"""
stop()
time.sleep(2)
start()

View File

@@ -1,13 +1,16 @@
#!/bin/bash
PIDFILE='auth.pid'
ROOT=`pwd`
PIDFILE=$ROOT/logs/auth.pid
mkdir logs 2> /dev/null
if [ -f $PIDFILE ]; then
kill `cat -- $PIDFILE`
kill `cat -- $PIDFILE` 2> /dev/null
rm -f -- $PIDFILE
fi
sleep 1
cd $ROOT
source ./env/bin/activate
./manage.py runfcgi daemonize=false pidfile=$PIDFILE host=127.0.0.1 port=9981 &
exit 0
./manage.py runfcgi daemonize=true pidfile=$PIDFILE host=127.0.0.1 port=9981 errlog=$ROOT/logs/stderr.log outlog=$ROOT/logs/stdout.log