diff --git a/dockers/docker-teamd/start.sh b/dockers/docker-teamd/start.sh index 268217272f6e..e68b3ed00b8f 100755 --- a/dockers/docker-teamd/start.sh +++ b/dockers/docker-teamd/start.sh @@ -2,9 +2,17 @@ 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 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