Permalink
Browse files

Bug 1123479 - add startup script for a prefork-based log parser

  • Loading branch information...
maurodoglio committed Feb 2, 2015
1 parent 119407a commit fd9eb1760325faf913ab07ccdffcdd9210f7fb69
Showing with 35 additions and 4 deletions.
  1. +31 −0 bin/run_celery_worker_log_parser
  2. +4 −4 deployment/supervisord/worker_node.conf
@@ -0,0 +1,31 @@
#!/bin/bash
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at http://mozilla.org/MPL/2.0/.
curr_dir=$( dirname "${BASH_SOURCE[0]}" )
cd $( dirname $curr_dir)
source /etc/profile.d/treeherder.sh
if [[ ${NEW_RELIC_LICENSE_KEY+isset} = isset ]]; then
NEWRELIC_ADMIN="newrelic-admin run-program"
fi
if [ -f ../venv/bin/celery ]; then
source ../venv/bin/activate
CELERY=../venv/bin/celery
else
CELERY=celery
fi
LOGFILE=/var/log/celery/celery_worker_log_parser.log
if [ ! -f $LOGFILE ]; then
touch $LOGFILE
fi
exec $NEWRELIC_ADMIN $CELERY -A treeherder worker \
-Q log_parser_fail,log_parser,log_parser_hp \
--logfile=$LOGFILE -l INFO \
--maxtasksperchild=500 -n log_parser.%h
@@ -10,14 +10,14 @@ nodaemon=true ; (start in foreground if true;default false)
[supervisorctl]
serverurl=unix:///var/tmp/supervisor.sock ; use a unix:// URL for a unix socket
[program:celery_gevent]
command=/home/vagrant/treeherder-service/bin/run_celery_worker_gevent
[program:celery_log_parser]
command=/home/vagrant/treeherder-service/bin/run_celery_worker_log_parser
user=vagrant
autostart=true
autorestart=true
startsecs=10
stopwaitsecs = 600
priority=998
stdout_logfile=/var/log/celery/worker_gevent.log
stderr_logfile=/var/log/celery/worker_gevent_err.log
stdout_logfile=/var/log/celery/worker_log_parser.log
stderr_logfile=/var/log/celery/worker_log_parser_err.log

0 comments on commit fd9eb17

Please sign in to comment.