Skip to content

Commit

Permalink
[docker-syncd-brcm] Reorganize start.sh (#2161)
Browse files Browse the repository at this point in the history
  • Loading branch information
jleveque authored Oct 18, 2018
1 parent 2a24a30 commit 164a1d3
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions platform/broadcom/docker-syncd-brcm/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit 164a1d3

Please sign in to comment.