From 9be8d2b3a79e0e209e4fee9991f611f86f9ff2bc Mon Sep 17 00:00:00 2001 From: Raymond Yee Date: Fri, 10 Oct 2014 17:00:28 -0700 Subject: [PATCH] just was not configured properly for celery --- deploy/celerybeat_just.conf | 36 ++++++++++++++++++++++++++++++++++++ deploy/celeryd_just.conf | 11 +++++++++++ deploy/update-just | 4 ++++ 3 files changed, 51 insertions(+) create mode 100644 deploy/celerybeat_just.conf create mode 100644 deploy/celeryd_just.conf diff --git a/deploy/celerybeat_just.conf b/deploy/celerybeat_just.conf new file mode 100644 index 00000000..2e82b9b7 --- /dev/null +++ b/deploy/celerybeat_just.conf @@ -0,0 +1,36 @@ +# http://docs.celeryproject.org/en/latest/cookbook/daemonizing.html#generic-initd-celerybeat-example +# to be placed at /etc/defaults/celerybeat + +# Where to chdir at start. +CELERYBEAT_CHDIR="/opt/regluit/" + +# Extra arguments to celerybeat +#CELERYBEAT_OPTS="--schedule=/var/run/celerybeat-schedule" + +# Name of the celery config module.# +CELERY_CONFIG_MODULE="celeryconfig" + +# Name of the projects settings module. +export DJANGO_SETTINGS_MODULE="regluit.settings.just" + +# Path to celerybeat +CELERYBEAT="/opt/regluit/ENV/bin/django-admin.py celerybeat" + +# virtualenv to use +VIRTUALENV="/opt/regluit/ENV" + +#Full path to the PID file. Default is /var/run/celeryd.pid +CELERYBEAT_PIDFILE="/var/log/celerybeat/celerybeat.pid" + +#Full path to the celeryd log file. Default is /var/log/celeryd.log +CELERYBEAT_LOGFILE="/var/log/celerybeat/celerybeat.log" + +#Log level to use for celeryd. Default is INFO. +CELERYBEAT_LOG_LEVEL="INFO" + + +#User to run celeryd as. Default is current user. +#CELERYBEAT_USER + +#Group to run celeryd as. Default is current user. +#CELERYBEAT_GROUP diff --git a/deploy/celeryd_just.conf b/deploy/celeryd_just.conf new file mode 100644 index 00000000..3e1ee05e --- /dev/null +++ b/deploy/celeryd_just.conf @@ -0,0 +1,11 @@ +CELERYD_NODES="w1" +CELERYD_CHDIR="/opt/regluit/" +CELERYD_LOG_FILE="/var/log/celery/%n.log" +CELERYD_PID_FILE="/var/log/celery/%n.pid" +CELERYD_USER="celery" +CELERYD_GROUP="celery" +CELERYD="/opt/regluit/ENV/bin/django-admin.py celeryd" +CELERYD_MULTI="/opt/regluit/ENV/bin/django-admin.py celeryd_multi" + +VIRTUALENV_ACTIVATE="/opt/regluit/ENV/bin/activate" +export DJANGO_SETTINGS_MODULE="regluit.settings.just" diff --git a/deploy/update-just b/deploy/update-just index 3c42147a..7316d8c1 100755 --- a/deploy/update-just +++ b/deploy/update-just @@ -12,6 +12,10 @@ source ENV/bin/activate pip install -r requirements_versioned.pip django-admin.py syncdb --migrate --settings regluit.settings.just django-admin.py collectstatic --noinput --settings regluit.settings.just + +sudo ln -s deploy/celeryd_just.conf /etc/default/celeryd +sudo ln -s deploy/celerybeat_just /etc/init.d/celerybeat + sudo /etc/init.d/apache2 restart sudo /etc/init.d/celeryd restart sudo /etc/init.d/celerybeat restart