Skip to content

Commit aa71231

Browse files
[reboot]: Stop mux before reboot on dual ToR (sonic-net#1500)
If the script detects it is running on a dual ToR system, stop the mux container before shutting down syncd This is necessary to prevent some links from flapping when the standby ToR is rebooted - when reboot stop syncd, the linkmgr will stop receiving heartbeats and will then tell the mux to switchover. However, since the device is rebooting, no heartbeats will be sent out. The peer ToR will see this absence of heartbeats and tell the mux to switch back to itself (the peer ToR), causing the flap. By stopping the mux container before shutting down syncd, we prevent the rebooting ToR from switching the mux. Signed-off-by: Lawrence Lee <[email protected]>
1 parent fbad274 commit aa71231

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

scripts/reboot

+5
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ fi
2424
REBOOT_USER=$(logname)
2525
PLATFORM=$(sonic-cfggen -H -v DEVICE_METADATA.localhost.platform)
2626
ASIC_TYPE=$(sonic-cfggen -y /etc/sonic/sonic_version.yml -v asic_type)
27+
SUBTYPE=$(sonic-cfggen -d -v DEVICE_METADATA.localhost.subtype)
2728
VERBOSE=no
2829
EXIT_NEXT_IMAGE_NOT_EXISTS=4
2930
EXIT_SONIC_INSTALLER_VERIFY_REBOOT=21
@@ -52,6 +53,10 @@ function tag_images()
5253

5354
function stop_sonic_services()
5455
{
56+
if [[ x"$SUBTYPE" == x"DualToR" ]]; then
57+
debug "DualToR detected, stopping mux container before reboot..."
58+
systemctl stop mux
59+
fi
5560
if [[ x"$ASIC_TYPE" != x"mellanox" ]]; then
5661
debug "Stopping syncd process..."
5762
docker exec -i syncd /usr/bin/syncd_request_shutdown --cold > /dev/null

0 commit comments

Comments
 (0)