diff --git a/dockers/docker-syncd-cavm/Dockerfile b/dockers/docker-syncd-cavm/Dockerfile index e8025011bb..41298a29ed 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 04c5a3a183..21d61e7073 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