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

This commit is contained in:
Guohan Lu 2020-05-16 01:04:04 +00:00
parent 763673993e
commit 9f5c5c7a4a
2 changed files with 27 additions and 16 deletions

View File

@ -2,8 +2,3 @@
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 restapi

View File

@ -3,19 +3,39 @@ 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 restapi
events=PROCESS_STATE_EXITED
autostart=true
autorestart=false
[program:start.sh]
command=/usr/bin/start.sh
[program:rsyslogd]
command=/usr/sbin/rsyslogd -n -iNONE
priority=1
autostart=true
autorestart=false
autostart=false
autorestart=true
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:restapi]
command=/usr/bin/restapi.sh
@ -24,11 +44,7 @@ autostart=false
autorestart=true
stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=start:exited
[program:rsyslogd]
command=/usr/sbin/rsyslogd -n
priority=2
autostart=false
autorestart=true
stdout_logfile=syslog
stderr_logfile=syslog