From 628708aa7a169c390890e2eb54710bb3cd1d3874 Mon Sep 17 00:00:00 2001 From: Denys Haryachyy Date: Fri, 25 Nov 2016 18:14:18 +0200 Subject: [PATCH] docker-syncd-cavm : Added synchronization between syncd and redis --- dockers/docker-syncd-cavm/Dockerfile | 2 +- dockers/docker-syncd-cavm/start.sh | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/dockers/docker-syncd-cavm/Dockerfile b/dockers/docker-syncd-cavm/Dockerfile index e8025011bb70..41298a29ede4 100755 --- a/dockers/docker-syncd-cavm/Dockerfile +++ b/dockers/docker-syncd-cavm/Dockerfile @@ -18,7 +18,7 @@ RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return && dpkg_apt /deps/libsaimetadata_*.deb \ && dpkg_apt /deps/syncd_*.deb -RUN apt-get -y install libpcap-dev libxml2-dev python-dev swig libsensors4-dev +RUN apt-get -y install libpcap-dev libxml2-dev python-dev swig libsensors4-dev redis-tools COPY ["start.sh", "/usr/bin/"] diff --git a/dockers/docker-syncd-cavm/start.sh b/dockers/docker-syncd-cavm/start.sh index 04c5a3a1835f..21d61e707344 100755 --- a/dockers/docker-syncd-cavm/start.sh +++ b/dockers/docker-syncd-cavm/start.sh @@ -3,4 +3,21 @@ export XP_ROOT=/usr/bin/ service rsyslog start -syncd -p /etc/ssw/AS7512/profile.ini -N + +while true; do + + # Check if redis-server starts + + result=$(redis-cli ping) + + if [ "$result" == "PONG" ]; then + + redis-cli FLUSHALL + syncd -p /etc/ssw/AS7512/profile.ini -N + break + + fi + + sleep 1 + +done