From e2398af134535601f8574678d7873622438e2673 Mon Sep 17 00:00:00 2001 From: Rama Chandra Reddy Gaddam Date: Wed, 22 May 2019 15:28:08 +0530 Subject: [PATCH] Check for broadcom platform sdk init ready during syncd start. --- platform/broadcom/docker-syncd-brcm/start.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/platform/broadcom/docker-syncd-brcm/start.sh b/platform/broadcom/docker-syncd-brcm/start.sh index 45c4ab92dabf..146b2efa7406 100755 --- a/platform/broadcom/docker-syncd-brcm/start.sh +++ b/platform/broadcom/docker-syncd-brcm/start.sh @@ -15,7 +15,20 @@ wait_syncd() { done # wait until bcm sdk is ready to get a request - sleep 3 + counter=0 + while true; do + /usr/bin/bcmcmd -t 1 "show unit" | grep BCM >/dev/null 2>&1 + rv=$? + if [ $rv -eq 0 ]; then + break + fi + counter=$((counter+1)) + if [ $counter -ge 60 ]; then + echo "syncd is not ready to take commands after $counter re-tries; Exiting!" + break + fi + sleep 1 + done }