2010-07-22 05:09:09 +02:00
|
|
|
#!/bin/sh
|
|
|
|
# this should be run as the TP_USER user
|
|
|
|
|
2010-08-16 00:04:54 +02:00
|
|
|
PYTHONPATH="/etc/teamplayer:$PYTHONPATH"
|
2011-04-10 05:45:35 +02:00
|
|
|
PYTHON=python2.7
|
2010-08-16 00:04:54 +02:00
|
|
|
export PYTHONPATH
|
|
|
|
|
2010-07-22 05:09:09 +02:00
|
|
|
cd ~
|
2010-08-16 00:04:54 +02:00
|
|
|
hg serve -p 8000 --prefix /repo/ > /var/log/teamplayer/hgserve.log 2>&1 &
|
2010-07-22 05:09:09 +02:00
|
|
|
|
|
|
|
cd ~/web
|
|
|
|
|
2010-08-16 00:04:54 +02:00
|
|
|
if [ ! -f "/etc/firstboot" ] ; then
|
2011-04-10 05:45:35 +02:00
|
|
|
$PYTHON manage.py syncdb --noinput --verbosity=0
|
2010-07-22 05:09:09 +02:00
|
|
|
fi
|
|
|
|
|
2010-08-22 15:22:10 +02:00
|
|
|
# start the fastcgi daemon
|
2011-04-10 05:45:35 +02:00
|
|
|
$PYTHON manage.py runfcgi daemonize=true protocol=fcgi maxrequest=20 \
|
2010-08-22 15:22:10 +02:00
|
|
|
pidfile="TP_DB/fcgi.pid" socket=TP_DB/teamplayer.sock umask=002 \
|
|
|
|
> "/var/log/teamplayer/teamplayer.log" 2>&1
|
|
|
|
|
2010-07-22 05:09:09 +02:00
|
|
|
# spin!
|
2011-04-10 05:45:35 +02:00
|
|
|
$PYTHON manage.py spin --verbosity=2 $@ > "/var/log/teamplayer/teamplayer.log" 2>&1 &
|
2010-08-16 00:04:54 +02:00
|
|
|
echo $! > "TP_DB/tps.pid"
|