changed python and gunicorn paths to be dynamic

This commit is contained in:
Jonathan Eads 2014-05-30 10:40:14 -07:00
Родитель 21bf167647
Коммит e8845853cc
2 изменённых файлов: 17 добавлений и 4 удалений

Просмотреть файл

@ -2,10 +2,17 @@
curr_dir=$( dirname "${BASH_SOURCE[0]}" )
cd $( dirname $curr_dir)
source /etc/profile.d/treeherder.sh
source ../venv/bin/activate
if [[ ${NEW_RELIC_LICENSE_KEY+isset} = isset ]]; then
NEWRELIC_ADMIN="newrelic-admin run-program"
fi
exec $NEWRELIC_ADMIN ../venv/bin/python manage.py celeryd -Q log_parser_fail,log_parser -P gevent --concurrency=10 -E --logfile=/var/log/celery/treeherder_worker_gevent.log -n gevent_worker.%h -l debug --maxtasksperchild=500
if [ -f ../venv/bin/python ]
then
source ../venv/bin/activate
PYTHON=../venv/bin/python
else
PYTHON=python
fi
exec $NEWRELIC_ADMIN $PYTHON manage.py celeryd -Q log_parser_fail,log_parser -P gevent --concurrency=10 -E --logfile=/var/log/celery/treeherder_worker_gevent.log -n gevent_worker.%h -l debug --maxtasksperchild=500

Просмотреть файл

@ -11,9 +11,15 @@
NUM_WORKERS=5
source /etc/profile.d/treeherder.sh
source ../venv/bin/activate
exec ../venv/bin/gunicorn -w $NUM_WORKERS \
if [ -f ../venv/bin/gunicorn ]
then
source ../venv/bin/activate
GUNICORN=../venv/bin/gunicorn
else
GUNICORN=/usr/bin/gunicorn
exec $GUNICORN -w $NUM_WORKERS \
--max-requests=2000 \
--access-logfile=$ACCESS_LOGFILE \
--error-logfile=$ERROR_LOGFILE treeherder.webapp.wsgi:application