diff --git a/dockers/docker-orchagent/swssconfig.sh b/dockers/docker-orchagent/swssconfig.sh index 826dc6e33f87..1de7165281cf 100755 --- a/dockers/docker-orchagent/swssconfig.sh +++ b/dockers/docker-orchagent/swssconfig.sh @@ -29,6 +29,13 @@ function fast_reboot { esac } +# Wait until swss.sh in the host system create file swss:/ready +until [[ -e /ready ]]; do + sleep 0.1; +done + +rm -f /ready + # Restore FDB and ARP table ASAP fast_reboot diff --git a/files/build_templates/docker_image_ctl.j2 b/files/build_templates/docker_image_ctl.j2 index c1a9b6ad412c..a0ccc434530b 100644 --- a/files/build_templates/docker_image_ctl.j2 +++ b/files/build_templates/docker_image_ctl.j2 @@ -7,15 +7,24 @@ function getMountPoint() function postStartAction() { -{%- if docker_container_name != "database" %} - : -{%- else %} +{%- if docker_container_name == "database" %} until [[ $(/usr/bin/docker exec database redis-cli ping | grep -c PONG) -gt 0 ]]; do sleep 1; done -{%- endif %} -{%- if docker_container_name == "snmp" %} +{%- elif docker_container_name == "swss" %} + docker exec swss rm -f /ready # remove cruft + if [[ -d /host/fast-reboot ]]; + then + test -e /host/fast-reboot/fdb.json && docker cp /host/fast-reboot/fdb.json swss:/ + test -e /host/fast-reboot/arp.json && docker cp /host/fast-reboot/arp.json swss:/ + test -e /host/fast-reboot/default_routes.json && docker cp /host/fast-reboot/default_routes.json swss:/ + rm -fr /host/fast-reboot + fi + docker exec swss touch /ready # signal swssconfig.sh to go +{%- elif docker_container_name == "snmp" %} docker exec -i database redis-cli -n 6 HSET 'DEVICE_METADATA|localhost' chassis_serial_number $(decode-syseeprom -s) +{%- else %} + # nothing {%- endif %} } diff --git a/src/sonic-utilities b/src/sonic-utilities index 05b910a55967..461470b0266b 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit 05b910a5596714d16ae4ccf12d2b9c1099eaeccd +Subproject commit 461470b0266b2408886e1d326d5d35f5b0616564