Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[teamd.sh]: Remove LAG interfaces on exit #643

Merged
merged 2 commits into from
Jun 8, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions dockers/docker-teamd/teamd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,22 @@

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 -A $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
teamsyncd &
}

function clean_up {
pkill -9 teamd
if [ "$(ls -A $TEAMD_CONF_PATH)" ]; then
for f in $TEAMD_CONF_PATH/*; do
teamd -f $f -k
done
fi
pkill -9 teamsyncd
exit
}
Expand Down