Skip to content

Commit

Permalink
[teamd]: Update the start.sh script to clean up the docker state (#351)
Browse files Browse the repository at this point in the history
This change should be temporary because the current teamd cannot
re-create net devices acrosss restart. Basically, it will fail
when there're files in /var/run/teamd/ folder or the previously
created net devices are still there. Thus, the current workaround
is to remove the obsolete files to restart the docker-teamd.

This workaround cannot resolve the swss restart issue. Before
restarting swss, docker teamd needs to be stopped manually. After
swss starts, docker teamd needs to be restarted manually.

This change will only make sure that rebooting the switch will
make the switch at the correct state.

Signed-off-by: Shuotian Cheng <shuche@microsoft.com>
  • Loading branch information
Shuotian Cheng authored Mar 2, 2017
1 parent 667ef1d commit f06dc5d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions dockers/docker-teamd/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f06dc5d

Please sign in to comment.