[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:
parent
cefd024c26
commit
3903b45d41
@ -2,17 +2,10 @@
|
|||||||
|
|
||||||
TEAMD_CONF_PATH=/etc/teamd
|
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 {
|
function start_app {
|
||||||
# Remove *.pid and *.sock files if there are any
|
|
||||||
rm -f /var/run/teamd/*
|
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
|
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
|
teamd -f $f -d
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
@ -20,7 +13,11 @@ function start_app {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function clean_up {
|
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
|
pkill -9 teamsyncd
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user