
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
17 lines
516 B
Django/Jinja
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
|