Commit 9e43b89f by Fred Smith

simplify notifier environment config

parent 742fed85
......@@ -85,6 +85,18 @@
file:
path="{{ NOTIFIER_HOME }}/bin" mode=2775 state=directory owner={{ NOTIFIER_USER }} group={{ NOTIFIER_USER }}
- name: write supervisord wrapper for celery workers
template: >
src=notifier-celery-workers-supervisor.sh.j2
dest="{{ NOTIFIER_HOME }}/notifier-celery-workers-supervisor.sh"
sudo_user: "{{ supervisor_user }}"
- name: write supervisord wrapper for scheduler
template: >
src=notifier-scheduler-supervisor.sh.j2
dest="{{ supervisor_available_dir }}/notifier-scheduler-supervisor.sh"
sudo_user: "{{ supervisor_user }}"
- name: write supervisord config for celery workers
template: >
src=edx/app/supervisor/conf.d/notifier-celery-workers.conf.j2
......
......@@ -3,7 +3,7 @@
;
[program:notifier-celery-workers]
command={{ NOTIFIER_VENV_DIR }}/bin/python manage.py celery worker -l {{ NOTIFIER_LOG_LEVEL }}
command={{ NOTIFIER_HOME }}/notifier-celery-workers-supervisor.sh
process_name=%(program_name)s
numprocs=1
......@@ -25,8 +25,3 @@ stderr_logfile={{ NOTIFIER_SUPERVISOR_LOG_DEST }}/notifier-celery-workers-stderr
stderr_logfile_maxbytes=1MB
stderr_logfile_backups=10
stderr_capture_maxbytes=1MB
environment=PID='/var/tmp/notifier-celery-workers.pid',LANG=en_US.UTF-8,
{%- do notifier_env_vars.update(NOTIFIER_ENV_EXTRA) -%}
{%- for name,value in notifier_env_vars.items() -%}
{%- if value -%}{{name}}="{{value}}"{%- if not loop.last -%},{%- endif -%}{%- endif -%}
{%- endfor -%}
......@@ -3,7 +3,7 @@
;
[program:notifier-scheduler]
command={{ NOTIFIER_VENV_DIR }}/bin/python manage.py scheduler
command={{ NOTIFIER_HOME }}/notifier-scheduler-supervisor.sh
process_name=%(program_name)s
numprocs=1
......@@ -25,8 +25,3 @@ stderr_logfile={{ NOTIFIER_SUPERVISOR_LOG_DEST }}/notifier-scheduler-stderr.log
stderr_logfile_maxbytes=1MB
stderr_logfile_backups=10
stderr_capture_maxbytes=1MB
environment=PID='/var/tmp/notifier-scheduler.pid',LANG=en_US.UTF-8,
{%- do notifier_env_vars.update(NOTIFIER_ENV_EXTRA) -%}
{%- for name,value in notifier_env_vars.items() -%}
{%- if value -%}{{name}}="{{value}}"{%- if not loop.last -%},{%- endif -%}{%- endif -%}
{%- endfor -%}
#!/bin/bash
source {{ NOTIFIER_HOME }}/notifier_env
cd {{ NOTIFIER_CODE_DIR }}
export PID='/var/tmp/notifier-scheduler.pid'
export LANG=en_US.UTF-8
{{ NOTIFIER_VENV_DIR }}/bin/python manage.py celery worker -l {{ NOTIFIER_LOG_LEVEL }}
#!/bin/bash
source {{ NOTIFIER_HOME }}/notifier_env
cd {{ NOTIFIER_CODE_DIR }}
export PID='/var/tmp/notifier-celery-workers.pid'
export LANG=en_US.UTF-8
{{ NOTIFIER_VENV_DIR }}/bin/python manage.py scheduler
......@@ -6,3 +6,6 @@
export {{ name }}="{{ value }}"
{% endif %}
{% endfor %}
{% if NOTIFIER_THEME_NAME != "" %}
export DJANGO_SETTINGS_MODULE=notifier.settings_local
{% endif %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment