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
Changes from 1 commit
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
14 changes: 14 additions & 0 deletions scripts/reboot
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,25 @@ function stop_sonic_services()
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
}

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 clear_warm_boot()
{
# If reboot is requested, make sure the outstanding warm-boot is cleared
Expand Down Expand Up @@ -178,6 +190,8 @@ if [ -x ${DEVPATH}/${PLATFORM}/${PLATFORM_UPDATE_REBOOT_CAUSE} ]; then
${DEVPATH}/${PLATFORM}/${PLATFORM_UPDATE_REBOOT_CAUSE}
fi

stop_pmon_service
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand you want to stop this at the last possible moment, but does it just make things simpler to add the logic to the existing stop_sonic_services() function?

Copy link
Contributor Author

@aravindmani-1 aravindmani-1 Mar 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is any platform API is introduced/invoked in between, it will fail as PMON is shutdown early.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a problem moving stop_sonic_service to here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aravindthoram can we consolidate the change in stop_sonic_services and move the call to there?

Copy link
Contributor Author

@aravindmani-1 aravindmani-1 Mar 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yxieca I'll commit the new changes soon.


if [ -x ${DEVPATH}/${PLATFORM}/${PLAT_REBOOT} ]; then
VERBOSE=yes debug "Rebooting with platform ${PLATFORM} specific tool ..."
exec ${DEVPATH}/${PLATFORM}/${PLAT_REBOOT} $@
Expand Down