Skip to content

Commit 164a1d3

Browse files
authored
[docker-syncd-brcm] Reorganize start.sh (#2161)
1 parent 2a24a30 commit 164a1d3

File tree

1 file changed

+18
-14
lines changed
  • platform/broadcom/docker-syncd-brcm

1 file changed

+18
-14
lines changed

platform/broadcom/docker-syncd-brcm/start.sh

+18-14
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,25 @@
33
PLATFORM_DIR=/usr/share/sonic/platform
44
HWSKU_DIR=/usr/share/sonic/hwsku
55

6+
SYNCD_SOCKET_FILE=/var/run/sswsyncd/sswsyncd.socket
7+
8+
# Function: wait until syncd has created the socket for bcmcmd to connect to
9+
wait_syncd() {
10+
while true; do
11+
if [ -e ${SYNCD_SOCKET_FILE} ]; then
12+
break
13+
fi
14+
sleep 1
15+
done
16+
17+
# wait until bcm sdk is ready to get a request
18+
sleep 3
19+
}
20+
21+
22+
# Remove stale files if they exist
623
rm -f /var/run/rsyslogd.pid
24+
rm -f ${SYNCD_SOCKET_FILE}
725

826
supervisorctl start rsyslogd
927

@@ -18,22 +36,8 @@ else
1836
fi
1937
fi
2038

21-
rm -f /var/run/sswsyncd/sswsyncd.socket
2239
supervisorctl start syncd
2340

24-
# Function: wait until syncd has created the socket for bcmcmd to connect to
25-
wait_syncd() {
26-
while true; do
27-
if [ -e /var/run/sswsyncd/sswsyncd.socket ]; then
28-
break
29-
fi
30-
sleep 1
31-
done
32-
33-
# wait until bcm sdk is ready to get a request
34-
sleep 3
35-
}
36-
3741
# If this platform has an initialization file for the Broadcom LED microprocessor, load it
3842
if [ -r ${PLATFORM_DIR}/led_proc_init.soc ]; then
3943
wait_syncd

0 commit comments

Comments
 (0)