From 82dc8ace12863cff08f80bb06dc418fa0e9edab7 Mon Sep 17 00:00:00 2001 From: Guohan Lu Date: Sat, 16 May 2020 16:06:05 +0000 Subject: [PATCH] [docker-syncd-bfn]: use service dependency in supervisord to start services --- platform/barefoot/docker-syncd-bfn/start.sh | 5 --- .../docker-syncd-bfn/supervisord.conf | 36 +++++++++++++------ 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/platform/barefoot/docker-syncd-bfn/start.sh b/platform/barefoot/docker-syncd-bfn/start.sh index 1a39db4a9d..0fcdef4a96 100755 --- a/platform/barefoot/docker-syncd-bfn/start.sh +++ b/platform/barefoot/docker-syncd-bfn/start.sh @@ -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 diff --git a/platform/barefoot/docker-syncd-bfn/supervisord.conf b/platform/barefoot/docker-syncd-bfn/supervisord.conf index 1744d6ffef..7083a174c5 100644 --- a/platform/barefoot/docker-syncd-bfn/supervisord.conf +++ b/platform/barefoot/docker-syncd-bfn/supervisord.conf @@ -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