2010-07-22 05:09:09 +02:00
|
|
|
#!/bin/sh
|
|
|
|
# this should be run as the TP_USER user
|
|
|
|
|
2013-07-22 15:33:36 +02:00
|
|
|
PYTHON=python
|
2014-01-06 04:14:53 +01:00
|
|
|
PYTHONPATH="$HOME" ; export PYTHONPATH
|
2013-07-22 15:33:36 +02:00
|
|
|
DJANGO_SETTINGS_MODULE="project.settings_local" ; export DJANGO_SETTINGS_MODULE
|
2010-08-16 00:04:54 +02:00
|
|
|
|
2010-07-22 05:09:09 +02:00
|
|
|
cd ~
|
2013-07-22 15:33:36 +02:00
|
|
|
. bin/activate
|
2010-07-22 05:09:09 +02:00
|
|
|
|
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
|
2013-07-22 15:33:36 +02:00
|
|
|
$PYTHON manage.py collectstatic --noinput --verbosity=0
|
2010-07-22 05:09:09 +02:00
|
|
|
fi
|
|
|
|
|
2014-01-06 04:14:53 +01:00
|
|
|
# start the uwsgi daemon
|
|
|
|
uwsgi --socket TP_DB/teamplayer.sock \
|
|
|
|
--chmod=660 \
|
|
|
|
-w project.wsgi \
|
|
|
|
--uid teamplayer \
|
|
|
|
--gid teamplayer \
|
|
|
|
--pidfile TP_DB/uwsgi.pid \
|
|
|
|
--daemonize2 /var/log/teamplayer/teamplayer.log \
|
|
|
|
-T
|
2010-08-22 15:22:10 +02:00
|
|
|
|
2013-07-22 15:33:36 +02:00
|
|
|
# Start the Spin Doctor
|
2014-01-06 04:14:53 +01:00
|
|
|
$PYTHON manage.py spindoctor --verbosity=2 $@ >> "/var/log/teamplayer/teamplayer.log" 2>&1 &
|
2010-08-16 00:04:54 +02:00
|
|
|
echo $! > "TP_DB/tps.pid"
|