25 lines
759 B
SYSTEMD
25 lines
759 B
SYSTEMD
|
[Unit]
|
||
|
Description=Gunicorn instance to serve OSP-RTMP
|
||
|
After=network.target ejabberd.service redis.service
|
||
|
PartOf=osp.target
|
||
|
|
||
|
{% if osp_db_type == "postgresql" %}
|
||
|
After=postgresql.service
|
||
|
{% endif %}
|
||
|
{% if osp_db_type == "mysql" %}
|
||
|
After=mysql.service
|
||
|
{% endif %}
|
||
|
|
||
|
[Service]
|
||
|
User=http
|
||
|
Group=http
|
||
|
WorkingDirectory=/opt/osp/installs/osp-rtmp/
|
||
|
Environment="VIRTUAL_ENV=/opt/osp-venv"
|
||
|
Environment="PATH=/opt/osp-venv/bin:/usr/local/bin:/usr/bin:/bin"
|
||
|
ExecStart=/opt/osp-venv/bin/gunicorn app:app -k geventwebsocket.gunicorn.workers.GeventWebSocketWorker -w 1 --bind 127.0.0.1:{{ osp_worker_rtmp_port }} --reload --access-logfile /var/log/osp/access.log --error-logfile /var/log/osp/error.log
|
||
|
Restart=on-failure
|
||
|
RestartSec=5m
|
||
|
|
||
|
[Install]
|
||
|
WantedBy=multi-user.target
|