23 lines
680 B
Bash
Executable File
23 lines
680 B
Bash
Executable File
#!/bin/sh
|
|
# this should be run as the TP_USER user
|
|
|
|
PYTHON=python
|
|
DJANGO_SETTINGS_MODULE="project.settings_local" ; export DJANGO_SETTINGS_MODULE
|
|
|
|
cd ~
|
|
. bin/activate
|
|
|
|
if [ ! -f "/etc/firstboot" ] ; then
|
|
$PYTHON manage.py syncdb --noinput --verbosity=0
|
|
$PYTHON manage.py collectstatic --noinput --verbosity=0
|
|
fi
|
|
|
|
# start the fastcgi daemon
|
|
$PYTHON manage.py runfcgi daemonize=true protocol=fcgi maxrequest=20 \
|
|
pidfile="TP_DB/fcgi.pid" socket=TP_DB/teamplayer.sock umask=002 \
|
|
> "/var/log/teamplayer/teamplayer.log" 2>&1
|
|
|
|
# Start the Spin Doctor
|
|
$PYTHON manage.py spindoctor --verbosity=2 $@ > "/var/log/teamplayer/teamplayer.log" 2>&1 &
|
|
echo $! > "TP_DB/tps.pid"
|