diff --git a/scripts/fast-reboot b/scripts/fast-reboot index 851e6694a080..e11e8667ff0f 100755 --- a/scripts/fast-reboot +++ b/scripts/fast-reboot @@ -418,12 +418,15 @@ docker kill lldp > /dev/null systemctl stop lldp if [[ "$REBOOT_TYPE" = "fast-reboot" ]]; then - # Kill teamd, otherwise it gets down all LAGs + # Kill teamd processes inside of teamd container with SIGUSR2 to allow them to send last LACP frames # We call `docker kill teamd` to ensure the container stops as quickly as possible, # then immediately call `systemctl stop teamd` to prevent the service from # restarting the container automatically. # Note: teamd must be killed before syncd, because it will send the last packet through CPU port - # TODO: stop teamd gracefully to allow teamd to send last valid update to be sure we'll have 90 seconds reboot time + docker exec -i teamd pkill -USR2 teamd || [ $? == 1 ] + while docker exec -i teamd pgrep teamd > /dev/null; do + sleep 0.05 + done docker kill teamd > /dev/null systemctl stop teamd fi