29 lines
747 B
Bash
Executable File
29 lines
747 B
Bash
Executable File
#!/bin/sh
|
|
# this should be run as the TP_USER user
|
|
|
|
PYTHON=python
|
|
PYTHONPATH="$HOME" ; export PYTHONPATH
|
|
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 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
|
|
|
|
# Start the Spin Doctor
|
|
$PYTHON manage.py spindoctor --verbosity=2 $@ >> "/var/log/teamplayer/teamplayer.log" 2>&1 &
|
|
echo $! > "TP_DB/tps.pid"
|