[docker-syncd-brcm] Reorganize start.sh (#2161)

This commit is contained in:
Joe LeVeque 2018-10-18 14:07:30 -07:00 committed by GitHub
parent 2a24a303ec
commit 164a1d3326
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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