From 745f58cde7d2253a7567707ee071c8c44c283e1e Mon Sep 17 00:00:00 2001 From: Guohan Lu Date: Sat, 16 May 2020 16:09:05 +0000 Subject: [PATCH] [docker-syncd-invm]: use service dependency in supervisord to start services --- .../innovium/docker-syncd-invm/Dockerfile.j2 | 1 - platform/innovium/docker-syncd-invm/start.sh | 7 ----- .../docker-syncd-invm/supervisord.conf | 29 ++++++++++--------- 3 files changed, 16 insertions(+), 21 deletions(-) delete mode 100755 platform/innovium/docker-syncd-invm/start.sh diff --git a/platform/innovium/docker-syncd-invm/Dockerfile.j2 b/platform/innovium/docker-syncd-invm/Dockerfile.j2 index 6f6f5eca9b..27054e23e4 100755 --- a/platform/innovium/docker-syncd-invm/Dockerfile.j2 +++ b/platform/innovium/docker-syncd-invm/Dockerfile.j2 @@ -24,7 +24,6 @@ RUN dpkg -i \ debs/{{ deb }}{{' '}} {%- endfor %} -COPY ["start.sh", "/usr/bin/"] COPY ["supervisord.conf", "/etc/supervisor/conf.d/"] ## Clean up diff --git a/platform/innovium/docker-syncd-invm/start.sh b/platform/innovium/docker-syncd-invm/start.sh deleted file mode 100755 index 6233160504..0000000000 --- a/platform/innovium/docker-syncd-invm/start.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -rm -f /var/run/rsyslogd.pid - -supervisorctl start rsyslogd - -supervisorctl start syncd diff --git a/platform/innovium/docker-syncd-invm/supervisord.conf b/platform/innovium/docker-syncd-invm/supervisord.conf index 1af5d70a1d..a614d68f28 100755 --- a/platform/innovium/docker-syncd-invm/supervisord.conf +++ b/platform/innovium/docker-syncd-invm/supervisord.conf @@ -3,26 +3,29 @@ logfile_maxbytes=1MB logfile_backups=2 nodaemon=true -[program:start.sh] -command=/usr/bin/start.sh -priority=1 +[eventlistener:dependent-startup] +command=python -m supervisord_dependent_startup autostart=true +autorestart=unexpected +startretries=0 +exitcodes=0,3 +events=PROCESS_STATE + +[program:rsyslogd] +command=/usr/sbin/rsyslogd -n -iNONE +priority=1 +autostart=false autorestart=false stdout_logfile=syslog stderr_logfile=syslog +dependent_startup=true -[program:rsyslogd] -command=/usr/sbin/rsyslogd -n +[program:syncd] +command=/usr/bin/syncd_start.sh priority=2 autostart=false autorestart=false stdout_logfile=syslog stderr_logfile=syslog - -[program:syncd] -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=rsyslogd:running