From 57ff53ea605bc5823661580d8d07f75993956c10 Mon Sep 17 00:00:00 2001 From: Denys Haryachyy Date: Mon, 28 Nov 2016 22:14:27 +0200 Subject: [PATCH] docker-syncd-cavm : Added synchronization between syncd and redis (#79) --- 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