Skip to content

Commit

Permalink
Use SIGUSR2 to stop teamd before fast-reboot (sonic-net#660)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-shirshov authored and lguohan committed Sep 20, 2019
1 parent 23960e7 commit b19b125
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/fast-reboot
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b19b125

Please sign in to comment.