Skip to content

Commit 0e84418

Browse files
Stop PMON docker before cold and soft reboots (sonic-net#1514)
Prevent potential kernel oops if drivers are removed/devices are deinitialized while PMon daemons are still trying to access those devices.
1 parent eba5c04 commit 0e84418

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

scripts/reboot

+13
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,30 @@ function tag_images()
5050
fi
5151
}
5252

53+
function stop_pmon_service()
54+
{
55+
CONTAINER_STOP_RC=0
56+
debug "Stopping pmon docker"
57+
docker kill pmon &> /dev/null || CONTAINER_STOP_RC=$?
58+
systemctl stop pmon || debug "Ignore stopping pmon error $?"
59+
if [[ CONTAINER_STOP_RC -ne 0 ]]; then
60+
debug "Failed killing container pmon RC $CONTAINER_STOP_RC ."
61+
fi
62+
}
63+
5364
function stop_sonic_services()
5465
{
5566
if [[ x"$SUBTYPE" == x"DualToR" ]]; then
5667
debug "DualToR detected, stopping mux container before reboot..."
5768
systemctl stop mux
5869
fi
70+
5971
if [[ x"$ASIC_TYPE" != x"mellanox" ]]; then
6072
debug "Stopping syncd process..."
6173
docker exec -i syncd /usr/bin/syncd_request_shutdown --cold > /dev/null
6274
sleep 3
6375
fi
76+
stop_pmon_service
6477
}
6578

6679
function clear_warm_boot()

scripts/soft-reboot

+12
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,25 @@ function tag_images()
5959
fi
6060
}
6161

62+
function stop_pmon_service()
63+
{
64+
CONTAINER_STOP_RC=0
65+
debug "Stopping pmon docker"
66+
docker kill pmon &> /dev/null || CONTAINER_STOP_RC=$?
67+
systemctl stop pmon || debug "Ignore stopping pmon error $?"
68+
if [[ CONTAINER_STOP_RC -ne 0 ]]; then
69+
debug "Failed killing container pmon RC $CONTAINER_STOP_RC ."
70+
fi
71+
}
72+
6273
function stop_sonic_services()
6374
{
6475
if [[ x"$ASIC_TYPE" != x"mellanox" ]]; then
6576
debug "Stopping syncd process..."
6677
docker exec -i syncd /usr/bin/syncd_request_shutdown --cold > /dev/null
6778
sleep 3
6879
fi
80+
stop_pmon_service
6981
}
7082

7183
function clear_lingering_reboot_config()

0 commit comments

Comments
 (0)