From 629362cad7b080fe738a4aafab6852a58e50160d Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Wed, 21 Jun 2017 18:53:28 -0700 Subject: [PATCH] [docker-syncd-brcm]: Sleep to allow syncd to create socket before calling bcmcmd (#733) * [docker-syncd-brcm]: Sleep to allow syncd to create socket before calling bcmcmd * Instead of fixed sleep interval, continually check for presence of socket --- platform/broadcom/docker-syncd-brcm/start.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/platform/broadcom/docker-syncd-brcm/start.sh b/platform/broadcom/docker-syncd-brcm/start.sh index 6f9b69ff8d..742cf82231 100755 --- a/platform/broadcom/docker-syncd-brcm/start.sh +++ b/platform/broadcom/docker-syncd-brcm/start.sh @@ -10,6 +10,14 @@ supervisorctl start syncd # If this platform has an initialization file for the Broadcom LED microprocessor, load it if [ -r ${PLATFORM_DIR}/led_proc_init.soc ]; then + # Wait until syncd has created the socket for bcmcmd to connect to + while true; do + if [ -e /var/run/sswsyncd/sswsyncd.socket ]; then + break + fi + sleep 1 + done + /usr/bin/bcmcmd -t 60 "rcload ${PLATFORM_DIR}/led_proc_init.soc" fi