Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop PMON docker before cold and soft reboots #1514

Merged
merged 7 commits into from
Apr 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions scripts/reboot
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
12 changes: 12 additions & 0 deletions scripts/soft-reboot
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,25 @@ 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
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