[docker-syncd-bfn]: use service dependency in supervisord to start services

This commit is contained in:
Guohan Lu 2020-05-16 16:06:05 +00:00 committed by lguohan
parent 5664f68bb7
commit 82dc8ace12
2 changed files with 25 additions and 16 deletions

View File

@ -1,9 +1,4 @@
#!/usr/bin/env bash
rm -f /var/run/rsyslogd.pid
supervisorctl start rsyslogd
. /opt/bfn/install/bin/dma_setup.sh
# . /opt/bfn/install/bin/bf_kdrv_mod_load /opt/bfn/install
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/bfn/install/lib supervisorctl start syncd

View File

@ -3,33 +3,47 @@ logfile_maxbytes=1MB
logfile_backups=2
nodaemon=true
[eventlistener:dependent-startup]
command=python -m supervisord_dependent_startup
autostart=true
autorestart=unexpected
startretries=0
exitcodes=0,3
events=PROCESS_STATE
[eventlistener:supervisor-proc-exit-listener]
command=/usr/bin/supervisor-proc-exit-listener --container-name syncd
events=PROCESS_STATE_EXITED
autostart=true
autorestart=unexpected
[program:start.sh]
command=/usr/bin/start.sh
priority=1
autostart=true
autorestart=false
stdout_logfile=syslog
stderr_logfile=syslog
[program:rsyslogd]
command=/usr/sbin/rsyslogd -n
priority=2
command=/usr/sbin/rsyslogd -n -iNONE
priority=1
autostart=false
autorestart=false
stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true
[program:start]
command=/usr/bin/start.sh
priority=2
autostart=false
autorestart=false
startsecs=0
stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=rsyslogd:running
[program:syncd]
environment=LD_LIBRARY_PATH="/opt/bfn/install/lib"
command=/usr/bin/syncd_start.sh
priority=3
autostart=false
autorestart=false
stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=start:exited