Skip to content

Commit 57ff53e

Browse files
garyachylguohan
authored andcommitted
docker-syncd-cavm : Added synchronization between syncd and redis (#79)
1 parent 96c2834 commit 57ff53e

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

dockers/docker-syncd-cavm/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return
1818
&& dpkg_apt /deps/libsaimetadata_*.deb \
1919
&& dpkg_apt /deps/syncd_*.deb
2020

21-
RUN apt-get -y install libpcap-dev libxml2-dev python-dev swig libsensors4-dev
21+
RUN apt-get -y install libpcap-dev libxml2-dev python-dev swig libsensors4-dev redis-tools
2222

2323
COPY ["start.sh", "/usr/bin/"]
2424

dockers/docker-syncd-cavm/start.sh

+18-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,21 @@
33
export XP_ROOT=/usr/bin/
44

55
service rsyslog start
6-
syncd -p /etc/ssw/AS7512/profile.ini -N
6+
7+
while true; do
8+
9+
# Check if redis-server starts
10+
11+
result=$(redis-cli ping)
12+
13+
if [ "$result" == "PONG" ]; then
14+
15+
redis-cli FLUSHALL
16+
syncd -p /etc/ssw/AS7512/profile.ini -N
17+
break
18+
19+
fi
20+
21+
sleep 1
22+
23+
done

0 commit comments

Comments
 (0)