diff --git a/dockers/docker-teamd/Dockerfile.j2 b/dockers/docker-teamd/Dockerfile.j2 index b3f35dd3c2e5..8fa045ff9e9c 100644 --- a/dockers/docker-teamd/Dockerfile.j2 +++ b/dockers/docker-teamd/Dockerfile.j2 @@ -26,5 +26,5 @@ ENV DEBIAN_FRONTEND=noninteractive RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y RUN rm -rf /debs -ENTRYPOINT ["/bin/bash", "-c"] -CMD ["/usr/bin/config.sh && /usr/bin/start.sh"] +ENTRYPOINT ["/bin/bash"] +CMD ["start.sh"] diff --git a/dockers/docker-teamd/start.sh b/dockers/docker-teamd/start.sh index 5397475defb7..51a16075c1ad 100755 --- a/dockers/docker-teamd/start.sh +++ b/dockers/docker-teamd/start.sh @@ -1,18 +1,12 @@ #!/bin/bash +. config.sh + TEAMD_CONF_PATH=/etc/teamd -# Before teamd could automatically add newly created host interfaces into the -# LAG, this workaround will be needed. It will remove the obsolete files and -# net devices that are failed to be removed in the previous run. function start_app { - # Remove *.pid and *.sock files if there are any - rm -f /var/run/teamd/* - if [ -d $TEAMD_CONF_PATH ]; then + if [ "$(ls $TEAMD_CONF_PATH)" ]; then for f in $TEAMD_CONF_PATH/*; do - # Remove netdevs if there are any - intf=`echo $f | awk -F'[/.]' '{print $4}'` - ip link del $intf teamd -f $f -d done fi @@ -20,7 +14,11 @@ function start_app { } function clean_up { - pkill -9 teamd + if [ "$(ls $TEAMD_CONF_PATH)" ]; then + for f in $TEAMD_CONF_PATH/*; do + teamd -f $f -k + done + fi pkill -9 teamsyncd service rsyslog stop exit @@ -31,15 +29,5 @@ trap clean_up SIGTERM SIGKILL rm -f /var/run/rsyslogd.pid service rsyslog start -# Before teamd could automatically add newly created host interfaces into the -# LAG, this workaround will wait until the host interfaces are created and then -# the processes will be started. -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 - start_app - read - fi - sleep 1 -done +start_app +read diff --git a/rules/swss.mk b/rules/swss.mk index c3f50e617e92..e704d55c76fe 100644 --- a/rules/swss.mk +++ b/rules/swss.mk @@ -4,7 +4,8 @@ SWSS = swss_1.0.0_amd64.deb $(SWSS)_SRC_PATH = $(SRC_PATH)/sonic-swss $(SWSS)_DEPENDS += $(LIBSAIREDIS_DEV) $(LIBSAIMETADATA_DEV) $(LIBTEAM_DEV) \ $(LIBTEAMDCT) $(LIBTEAM_UTILS) $(LIBSWSSCOMMON_DEV) -$(SWSS)_RDEPENDS += $(LIBSAIREDIS) $(LIBSAIMETADATA) $(LIBTEAM) $(LIBSWSSCOMMON) +$(SWSS)_RDEPENDS += $(LIBSAIREDIS) $(LIBSAIMETADATA) $(LIBTEAM) $(LIBSWSSCOMMON) \ + $(LIBTEAMDCT) SONIC_DPKG_DEBS += $(SWSS) SWSS_DBG = swss-dbg_1.0.0_amd64.deb