From 17b9e80be26e0a940759421b128dc54e009f7792 Mon Sep 17 00:00:00 2001 From: Shuotian Cheng Date: Thu, 2 Mar 2017 15:49:21 -0800 Subject: [PATCH] [teamd]: Add redis-tools as the dependency of docker-teamd and fix bugs - Fix the if condition bug to wait till PORT_TABLE:ConfigDone before start Signed-off-by: Shuotian Cheng --- dockers/docker-teamd/Dockerfile.j2 | 4 ++++ dockers/docker-teamd/start.sh | 2 +- rules/docker-teamd.mk | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dockers/docker-teamd/Dockerfile.j2 b/dockers/docker-teamd/Dockerfile.j2 index 32e302971ed2..b3f35dd3c2e5 100644 --- a/dockers/docker-teamd/Dockerfile.j2 +++ b/dockers/docker-teamd/Dockerfile.j2 @@ -2,6 +2,10 @@ FROM docker-config-engine RUN apt-get update && apt-get install -f -y libdbus-1-3 libdaemon0 libjansson4 +## Install redis-tools dependencies +## TODO: implicitly install dependencies +RUN apt-get -y install libjemalloc1 + COPY \ {% for deb in docker_teamd_debs.split(' ') -%} debs/{{ deb }}{{' '}} diff --git a/dockers/docker-teamd/start.sh b/dockers/docker-teamd/start.sh index 268217272f6e..b992a931e3d6 100755 --- a/dockers/docker-teamd/start.sh +++ b/dockers/docker-teamd/start.sh @@ -28,7 +28,7 @@ service rsyslog start while true; do # Check if front-panel ports are configured result=`echo -en "SELECT 0\nHGETALL PORT_TABLE:ConfigDone" | redis-cli | sed -n 3p` - if [ "$result" != "0" ]; then + if [ "$result" == "0" ]; then start_app read fi diff --git a/rules/docker-teamd.mk b/rules/docker-teamd.mk index f023c3598fa1..14038fcd0381 100644 --- a/rules/docker-teamd.mk +++ b/rules/docker-teamd.mk @@ -2,7 +2,7 @@ DOCKER_TEAMD = docker-teamd.gz $(DOCKER_TEAMD)_PATH = $(DOCKERS_PATH)/docker-teamd -$(DOCKER_TEAMD)_DEPENDS += $(SWSS) $(LIBTEAMDCT) $(LIBTEAM_UTILS) +$(DOCKER_TEAMD)_DEPENDS += $(SWSS) $(LIBTEAMDCT) $(LIBTEAM_UTILS) $(REDIS_TOOLS) $(DOCKER_TEAMD)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE) SONIC_DOCKER_IMAGES += $(DOCKER_TEAMD) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_TEAMD)