ara-infra/roles/ara_server/templates/ara-server.service.j2

23 lines
722 B
Django/Jinja

[Unit]
Description=ARA Records Ansible API server with gunicorn
After=network.target
[Service]
PIDFile=/run/ara-server/pid
User={{ ara_server_user }}
Group={{ ara_server_group }}
RuntimeDirectory=ara-server
WorkingDirectory={{ ara_server_home_dir }}
Environment=ARA_SETTINGS={{ ara_server_settings }}
{% if ara_server_venv %}
ExecStart={{ ara_server_venv_path }}/bin/gunicorn --pid /run/ara-server/pid --workers=4 --bind {{ ara_server_wsgi_bind }} ara.server.wsgi
{% else %}
ExecStart=gunicorn --pid /run/ara-server/pid --workers=4 --bind {{ ara_server_wsgi_bind }} ara.server.wsgi
{% endif %}
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s TERM $MAINPID
PrivateTmp=true
[Install]
WantedBy=multi-user.target