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

Signed-off-by: Guohan Lu <lguohan@gmail.com>
This commit is contained in:
Guohan Lu 2020-05-14 22:44:41 +00:00 committed by lguohan
parent 0c005fdb1c
commit 267b0b7aa8
2 changed files with 22 additions and 15 deletions

View File

@ -10,9 +10,3 @@ sonic-cfggen -d -t /usr/share/sonic/templates/iccpd.j2 > $ICCPD_CONF_PATH/iccpd.
mkdir -p /var/sonic mkdir -p /var/sonic
echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status
rm -f /var/run/rsyslogd.pid
supervisorctl start rsyslogd
supervisorctl start iccpd

View File

@ -3,21 +3,33 @@ logfile_maxbytes=1MB
logfile_backups=2 logfile_backups=2
nodaemon=true nodaemon=true
[program:start.sh] [eventlistener:dependent-startup]
command=/usr/bin/start.sh command=python -m supervisord_dependent_startup
priority=1
autostart=true autostart=true
autorestart=false autorestart=unexpected
stdout_logfile=syslog startretries=0
stderr_logfile=syslog exitcodes=0,3
events=PROCESS_STATE
[program:rsyslogd] [program:rsyslogd]
command=/usr/sbin/rsyslogd -n command=/usr/sbin/rsyslogd -n -iNONE
priority=2 priority=1
autostart=false autostart=false
autorestart=false autorestart=false
stdout_logfile=syslog stdout_logfile=syslog
stderr_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] [program:iccpd]
command=/usr/bin/iccpd.sh command=/usr/bin/iccpd.sh
@ -26,4 +38,5 @@ autostart=false
autorestart=false autorestart=false
stdout_logfile=syslog stdout_logfile=syslog
stderr_logfile=syslog stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=start:exited