2020-11-12 11:41:52 +01:00
|
|
|
[Unit]
|
|
|
|
Description=Gunicorn instance to serve OSP Workers on port %i
|
2020-11-12 17:46:31 +01:00
|
|
|
After=network.target ejabberd.service redis.service
|
2020-11-12 11:41:52 +01:00
|
|
|
PartOf=osp.target
|
|
|
|
|
2020-11-14 10:22:25 +01:00
|
|
|
{% if osp_db_type == "postgresql" %}
|
|
|
|
After=postgresql.service
|
|
|
|
{% endif %}
|
|
|
|
|
2020-11-12 11:41:52 +01:00
|
|
|
[Service]
|
|
|
|
User=http
|
|
|
|
Group=http
|
2020-11-12 22:02:15 +01:00
|
|
|
WorkingDirectory=/opt/osp
|
2020-11-12 11:41:52 +01:00
|
|
|
Environment="VIRTUAL_ENV=/opt/osp-venv"
|
|
|
|
Environment="PATH=/opt/osp-venv/bin:/usr/local/bin:/usr/bin:/bin"
|
2020-11-14 10:22:25 +01:00
|
|
|
ExecStart=/opt/osp-venv/bin/gunicorn app:app -k geventwebsocket.gunicorn.workers.GeventWebSocketWorker -w {{ osp_worker_worker }} --bind 0.0.0.0:%i --timeout {{ osp_worker_timeout }} --reload --access-logfile /var/log/osp/access.log --error-logfile /var/log/osp/error.log
|
2020-11-13 14:17:14 +01:00
|
|
|
Restart=on-failure
|
|
|
|
RestartSec=5m
|
2020-11-12 11:41:52 +01:00
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|