Skip to content

Commit

Permalink
1/ Use ALL_PEERS_RUNNING 2/ Monitor container gbsyncd
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmyzhai committed Apr 18, 2022
1 parent b299b7c commit e7a6ff8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
19 changes: 11 additions & 8 deletions files/scripts/swss.sh
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,17 @@ wait() {
# NOTE: This assumes Docker containers share the same names as their
# corresponding services
for SECS in {1..60}; do
ALL_PEERS_RUNNING=true
for peer in ${PEER}; do
if [[ ! -z $DEV ]]; then
RUNNING=$(docker inspect -f '{{.State.Running}}' ${peer}$DEV)
else
RUNNING=$(docker inspect -f '{{.State.Running}}' ${peer})
fi
if [[ x"$RUNNING" != x"true" ]]; then
ALL_PEERS_RUNNING=false
break
fi
done
ALL_DEPS_RUNNING=true
for dep in ${MULTI_INST_DEPENDENT}; do
Expand All @@ -231,7 +236,7 @@ wait() {
fi
done

if [[ x"$RUNNING" == x"true" && x"$ALL_DEPS_RUNNING" == x"true" ]]; then
if [[ x"$ALL_PEERS_RUNNING" == x"true" && x"$ALL_DEPS_RUNNING" == x"true" ]]; then
break
else
sleep 1
Expand All @@ -248,13 +253,11 @@ wait() {
fi
done

for peer in ${PEER}; do
if [[ ! -z $DEV ]]; then
/usr/bin/docker-wait-any -s ${SERVICE}$DEV -d ${peer}$DEV ${ALL_DEPS}
else
/usr/bin/docker-wait-any -s ${SERVICE} -d ${peer} ${ALL_DEPS}
fi
done
if [[ ! -z $DEV ]]; then
/usr/bin/docker-wait-any -s ${SERVICE}$DEV -d `printf "%s$DEV " ${PEER}` ${ALL_DEPS}
else
/usr/bin/docker-wait-any -s ${SERVICE} -d ${PEER} ${ALL_DEPS}
fi
}

stop() {
Expand Down
8 changes: 8 additions & 0 deletions platform/components/docker-gbsyncd-credo/supervisord.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ autorestart=unexpected
startretries=0
exitcodes=0,3
events=PROCESS_STATE
buffer_size=1024

[eventlistener:supervisor-proc-exit-listener]
command=/usr/bin/supervisor-proc-exit-listener --container-name gbsyncd
events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING
autostart=true
autorestart=unexpected
buffer_size=1024

[program:rsyslogd]
command=/usr/sbin/rsyslogd -n -iNONE
Expand Down

0 comments on commit e7a6ff8

Please sign in to comment.