Commit f9f5c952 authored by jaywink's avatar jaywink

Support Ubuntu 15.04 onwards by adding systemd service

parent da991ce4
......@@ -3,3 +3,13 @@
template: dest=/etc/init/{{ socialhome_domain }}-circus.conf src=circus_upstart.conf
notify:
- restart circus
when: not _systemd
- name: Set up circus systemd service
template: dest=/etc/systemd/system/{{ socialhome_domain }}-circus.service src=circus_systemd.service
notify:
- restart circus
when: _systemd
- name: Reload systemd daemon
systemd: daemon_reload=yes
---
- set_fact:
_systemd: "{{ true if ansible_lsb.major_release >= 15 else false }}"
- include: packages.yaml
- include: user.yaml
- include: uwsgi.yaml
......
......@@ -16,6 +16,7 @@
# uWSGI
- build-essential
- python-dev
- python3-dev
# Virtualenv
- python-virtualenv
- python3-setuptools
......
[Unit]
Description={{ socialhome_domain }} service
After=syslog.target network.target
[Service]
Environment=DJANGO_SETTINGS_MODULE="config.settings.production"
Environment=PYTHONPATH="/home/{{ socialhome_os_user }}/socialhome"
Environment=SOCIALHOME_HOME="/home/{{ socialhome_os_user }}"
Environment=RQWORKER_NUM={{ socialhome_rq_workers }}
Environment=VIRTUAL_ENV=/home/{{ socialhome_os_user }}/venv
User={{ socialhome_os_user }}
Group={{ socialhome_os_user }}
WorkingDirectory=/home/{{ socialhome_os_user }}/socialhome
ExecStart=/home/{{ socialhome_os_user }}/venv/bin/circusd /home/{{ socialhome_os_user }}/socialhome/config/circus.ini
Restart=always
[Install]
WantedBy=multi-user.target
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