David Moreau Simard 7b538c7342 ara_api: set path to gunicorn properly when not using virtualenv
Because ~/.local/bin might not be in PATH, the systemd service could
potentially not find gunicorn if it wasn't installed in a virtualenv.

Change-Id: Ie7d0fb2319277ac66d55db34a6239b412d56f3ba
2020-07-24 02:10:05 +00:00

17 lines
516 B
Django/Jinja

[Unit]
Description=ARA Records Ansible API with gunicorn
After=network.target
[Service]
User={{ ansible_user_id }}
RuntimeDirectory=ara-api
WorkingDirectory={{ ara_api_root_dir }}
Environment=ARA_SETTINGS={{ ara_api_settings }}
ExecStart={{ _gunicorn_path }} --workers={{ ara_api_wsgi_workers }} --bind {{ ara_api_wsgi_bind }} {{ _ara_api_wsgi_application | default('ara.server.wsgi') }}
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s TERM $MAINPID
PrivateTmp=true
[Install]
WantedBy=multi-user.target