Skip to content

Commit

Permalink
Remove exec from platform_reboot call to prevent reboot hang (sonic-n…
Browse files Browse the repository at this point in the history
…et#1881)

Port fix from master to stop pmon service for reboot and soft-reboot

What I did
Remove exec from the platform_reboot call to handle any hang issue during reboot
Port missing fix from master : stop pmon service for reboot and soft-reboot

How I did it
Remove "exec" from " exec ${DEVPATH}/${PLATFORM}/${PLAT_REBOOT} $@"

How to verify it
Perform sudo reboot after DE initializing the platfom driver and see if the device gracefully reboots by /sbin/reboot after failing on platform_reboot.
  • Loading branch information
sujinmkang authored Oct 26, 2021
1 parent 3b78032 commit 066b5ad
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
14 changes: 13 additions & 1 deletion scripts/reboot
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,25 @@ 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
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()
Expand Down Expand Up @@ -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:
#
Expand Down
12 changes: 12 additions & 0 deletions scripts/soft-reboot
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,25 @@ 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
debug "Stopping syncd process..."
docker exec -i syncd /usr/bin/syncd_request_shutdown --cold > /dev/null
sleep 3
fi
stop_pmon_service
}

function clear_lingering_reboot_config()
Expand Down

0 comments on commit 066b5ad

Please sign in to comment.