switch to supervisord, first step for multichannel support

This commit is contained in:
jb-alvarado 2020-12-27 20:54:39 +01:00
parent 210df1234a
commit 5ee2a3815a
5 changed files with 36 additions and 9 deletions

View File

@ -1,12 +1,15 @@
[Unit]
Description=python and ffmpeg based playout
Description=Supervisor process control system for UNIX
Documentation=http://supervisord.org
After=network.target
[Service]
ExecStart=/opt/ffplayout-engine/venv/bin/python /opt/ffplayout-engine/ffplayout.py
ExecReload=/bin/kill -1 $MAINPID
Restart=always
RestartSec=1
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

View File

@ -1,3 +1,4 @@
watchdog
colorama
pyyaml
supervisor
watchdog

View File

@ -1,4 +1,4 @@
colorama==0.4.3
pathtools==0.1.2
colorama==0.4.4
PyYAML==5.3.1
watchdog==0.10.3
supervisor==4.2.1
watchdog==1.0.2

View File

@ -0,0 +1,9 @@
[program:ffplayout-engine-001]
directory=/opt/ffplayout-engine
command=./venv/bin/python3 ffplayout.py # -c ffplayout.yml
killasgroup=true
stopasgroup=true
autorestart=true
autostart=true
startsecs=2
startretries=10

View File

@ -0,0 +1,14 @@
[supervisord]
# user=ffplayout
[include]
files = conf.d/*.conf
[inet_http_server]
port=127.0.0.1:9011
[supervisorctl]
serverurl=http://127.0.0.1:9011
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface