From 267b0b7aa8ed6c732fafa59e0ee862526110a96c Mon Sep 17 00:00:00 2001 From: Guohan Lu Date: Thu, 14 May 2020 22:44:41 +0000 Subject: [PATCH] [docker-iccpd]: use service dependency in supervisord to start services Signed-off-by: Guohan Lu --- dockers/docker-iccpd/start.sh | 6 ------ dockers/docker-iccpd/supervisord.conf | 31 +++++++++++++++++++-------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/dockers/docker-iccpd/start.sh b/dockers/docker-iccpd/start.sh index d17634cb83..f2e9807f31 100644 --- a/dockers/docker-iccpd/start.sh +++ b/dockers/docker-iccpd/start.sh @@ -10,9 +10,3 @@ sonic-cfggen -d -t /usr/share/sonic/templates/iccpd.j2 > $ICCPD_CONF_PATH/iccpd. mkdir -p /var/sonic echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status - -rm -f /var/run/rsyslogd.pid - -supervisorctl start rsyslogd - -supervisorctl start iccpd diff --git a/dockers/docker-iccpd/supervisord.conf b/dockers/docker-iccpd/supervisord.conf index dc71f07c6c..38d1ee56e6 100644 --- a/dockers/docker-iccpd/supervisord.conf +++ b/dockers/docker-iccpd/supervisord.conf @@ -3,21 +3,33 @@ 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=false -stdout_logfile=syslog -stderr_logfile=syslog +autorestart=unexpected +startretries=0 +exitcodes=0,3 +events=PROCESS_STATE [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:iccpd] command=/usr/bin/iccpd.sh @@ -26,4 +38,5 @@ autostart=false autorestart=false stdout_logfile=syslog stderr_logfile=syslog - +dependent_startup=true +dependent_startup_wait_for=start:exited