diff --git a/scripts/reboot b/scripts/reboot index 24607fb09590..546aa0fbff8b 100755 --- a/scripts/reboot +++ b/scripts/reboot @@ -50,17 +50,30 @@ function tag_images() fi } +function stop_pmon_service() +{ + CONTAINER_STOP_RC=0 + debug "Stopping pmon docker" + docker kill pmon &> /dev/null || CONTAINER_STOP_RC=$? + systemctl stop pmon || debug "Ignore stopping pmon error $?" + if [[ CONTAINER_STOP_RC -ne 0 ]]; then + debug "Failed killing container pmon RC $CONTAINER_STOP_RC ." + fi +} + function stop_sonic_services() { if [[ x"$SUBTYPE" == x"DualToR" ]]; then debug "DualToR detected, stopping mux container before reboot..." systemctl stop mux fi + if [[ x"$ASIC_TYPE" != x"mellanox" ]]; then debug "Stopping syncd process..." docker exec -i syncd /usr/bin/syncd_request_shutdown --cold > /dev/null sleep 3 fi + stop_pmon_service } function clear_warm_boot() diff --git a/scripts/soft-reboot b/scripts/soft-reboot index 52ccdd690b0d..504c58caffee 100755 --- a/scripts/soft-reboot +++ b/scripts/soft-reboot @@ -59,6 +59,17 @@ function tag_images() fi } +function stop_pmon_service() +{ + CONTAINER_STOP_RC=0 + debug "Stopping pmon docker" + docker kill pmon &> /dev/null || CONTAINER_STOP_RC=$? + systemctl stop pmon || debug "Ignore stopping pmon error $?" + if [[ CONTAINER_STOP_RC -ne 0 ]]; then + debug "Failed killing container pmon RC $CONTAINER_STOP_RC ." + fi +} + function stop_sonic_services() { if [[ x"$ASIC_TYPE" != x"mellanox" ]]; then @@ -66,6 +77,7 @@ function stop_sonic_services() docker exec -i syncd /usr/bin/syncd_request_shutdown --cold > /dev/null sleep 3 fi + stop_pmon_service } function clear_lingering_reboot_config()