support systemd and supervisord

This commit is contained in:
jb-alvarado 2021-02-04 17:18:46 +01:00
parent 6d87447cf4
commit d6c57c8aa7
3 changed files with 23 additions and 9 deletions

View File

@ -0,0 +1,17 @@
[Unit]
Description=Supervisor process control system for UNIX
Documentation=http://supervisord.org
After=network.target
[Service]
ExecStart=/opt/ffplayout-engine/venv/bin/supervisord -n -c /opt/ffplayout-engine/supervisor/supervisord.conf
ExecStop=/opt/ffplayout-engine/venv/bin/supervisorctl $OPTIONS shutdown
ExecReload=/opt/ffplayout-engine/venv/bin/supervisorctl $OPTIONS reload
KillMode=process
Restart=on-failure
RestartSec=5s
User=root
Group=root
[Install]
WantedBy=multi-user.target

View File

@ -1,15 +1,12 @@
[Unit] [Unit]
Description=Supervisor process control system for UNIX Description=python and ffmpeg based playout
Documentation=http://supervisord.org
After=network.target After=network.target
[Service] [Service]
ExecStart=/opt/ffplayout-engine/venv/bin/supervisord -n -c /opt/ffplayout-engine/supervisor/supervisord.conf ExecStart=/opt/ffplayout-engine/venv/bin/python /opt/ffplayout-engine/ffplayout.py
ExecStop=/opt/ffplayout-engine/venv/bin/supervisorctl $OPTIONS shutdown ExecReload=/bin/kill -1 $MAINPID
ExecReload=/opt/ffplayout-engine/venv/bin/supervisorctl $OPTIONS reload Restart=always
KillMode=process RestartSec=1
Restart=on-failure
RestartSec=5s
User=root User=root
Group=root Group=root

View File

@ -1,6 +1,6 @@
[program:engine-001] [program:engine-001]
directory=/opt/ffplayout-engine directory=/opt/ffplayout-engine
command=./venv/bin/python3 ffplayout.py # -c ffplayout.yml command=./venv/bin/python3 ffplayout.py -c /etc/ffplayout/ffplayout-001.yml
killasgroup=true killasgroup=true
stopasgroup=true stopasgroup=true
autorestart=true autorestart=true