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

Use -k option for teamd to properly remove LAG interfaces when docker is
exiting.

Signed-off-by: marian-pritsak <marianp@mellanox.com>
This commit is contained in:
Marian Pritsak 2017-06-08 11:53:51 +03:00 committed by lguohan
parent cefd024c26
commit 3903b45d41

View File

@ -2,17 +2,10 @@
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
@ -20,7 +13,11 @@ function start_app {
}
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
}