python djangoの起動スクリプト

1079 ワード

<!-- lang: shell -->
    #!/bin/bash

# Replace these three settings.
PROJDIR="/var/www/t_receive_interface"
PIDFILE="/var/run/django.pid"
SOCKET="/tmp/django.sock"
OUTLOGFILE="/var/log/django/access.out.log"
ERRLOGFILE="/var/log/django/error.log"

cd $PROJDIR
if [ -f $PIDFILE ]; then
    kill `cat -- $PIDFILE`
    rm -f -- $PIDFILE
fi

# as harbin
#exec python manage.py runfcgi maxchildren=1 maxspare=1 minspare=1 pidfile=$PIDFILE host=127.0.0.1 port=8088 method=prefork outlog=$OUTLOGFILE errlog=$ERRLOGFILE

# as  Bejing  
#exec python manage.py runfcgi maxchildren=4 maxspare=2 minspare=2 pidfile=$PIDFILE host=127.0.0.1 port=8088 method=prefork outlog=$OUTLOGFILE errlog=$ERRLOGFILE
#self
exec python manage.py runfcgi maxchildren=6 maxspare=3 minspare=3 pidfile=$PIDFILE host=127.0.0.1 port=8088 method=prefork outlog=$OUTLOG    FILE errlog=$ERRLOGFILE

#exec python manage.py runfcgi maxchildren=20 maxspare=20 minspare=15 pidfile=$PIDFILE socket=$SOCKET method=prefork umask=777
#chmod 777 $SOCKET