diff --git a/scripts/reboot b/scripts/reboot index 404bb187bc..4e48ba04c8 100755 --- a/scripts/reboot +++ b/scripts/reboot @@ -22,6 +22,17 @@ function debug() logger "$@" } +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 @@ -29,6 +40,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_warm_boot() @@ -141,7 +153,7 @@ fi if [ -x ${DEVPATH}/${PLATFORM}/${PLAT_REBOOT} ]; then VERBOSE=yes debug "Rebooting with platform ${PLATFORM} specific tool ..." - exec ${DEVPATH}/${PLATFORM}/${PLAT_REBOOT} $@ + ${DEVPATH}/${PLATFORM}/${PLAT_REBOOT} $@ # There are a couple reasons execution reaches here: # diff --git a/scripts/soft-reboot b/scripts/soft-reboot index 3c7c9b6261..5c70e3a1ae 100755 --- a/scripts/soft-reboot +++ b/scripts/soft-reboot @@ -27,6 +27,17 @@ function debug() logger "$@" } +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 @@ -34,6 +45,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()