From 164a1d3326119d0c3c42d9f27485680093265840 Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Thu, 18 Oct 2018 14:07:30 -0700 Subject: [PATCH] [docker-syncd-brcm] Reorganize start.sh (#2161) --- platform/broadcom/docker-syncd-brcm/start.sh | 32 +++++++++++--------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/platform/broadcom/docker-syncd-brcm/start.sh b/platform/broadcom/docker-syncd-brcm/start.sh index c52e5cb202..98c7d9c15a 100755 --- a/platform/broadcom/docker-syncd-brcm/start.sh +++ b/platform/broadcom/docker-syncd-brcm/start.sh @@ -3,7 +3,25 @@ PLATFORM_DIR=/usr/share/sonic/platform HWSKU_DIR=/usr/share/sonic/hwsku +SYNCD_SOCKET_FILE=/var/run/sswsyncd/sswsyncd.socket + +# Function: wait until syncd has created the socket for bcmcmd to connect to +wait_syncd() { + while true; do + if [ -e ${SYNCD_SOCKET_FILE} ]; then + break + fi + sleep 1 + done + + # wait until bcm sdk is ready to get a request + sleep 3 +} + + +# Remove stale files if they exist rm -f /var/run/rsyslogd.pid +rm -f ${SYNCD_SOCKET_FILE} supervisorctl start rsyslogd @@ -18,22 +36,8 @@ else fi fi -rm -f /var/run/sswsyncd/sswsyncd.socket supervisorctl start syncd -# Function: wait until syncd has created the socket for bcmcmd to connect to -wait_syncd() { - while true; do - if [ -e /var/run/sswsyncd/sswsyncd.socket ]; then - break - fi - sleep 1 - done - - # wait until bcm sdk is ready to get a request - sleep 3 -} - # If this platform has an initialization file for the Broadcom LED microprocessor, load it if [ -r ${PLATFORM_DIR}/led_proc_init.soc ]; then wait_syncd