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

internal [202305] Add the pre_reboot_hook script execution, add the watchdog arm before the reboot #26

Closed
wants to merge 1 commit into from

Conversation

vadymhlushko-mlnx
Copy link
Owner

@vadymhlushko-mlnx vadymhlushko-mlnx commented Nov 27, 2023

What I did

Add the pre_reboot_hook script execution, add the watchdog arm before the reboot, in order to support the graceful reboot instead of the sysfs power cycle, to avoid filesystem corruption.

How I did it

Modify the scripts/reboot

How to verify it

  1. Start watching logs by using show log -f and journalctl -p debug -f
  2. Execute the reboot command from the switch CLI
  3. Check in logs that all systemd services terminated correctly

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

@vadymhlushko-mlnx vadymhlushko-mlnx force-pushed the 202305-graceful-shutdown branch 5 times, most recently from fa4ec22 to 35c42f7 Compare November 28, 2023 14:20
scripts/reboot Outdated
Comment on lines 251 to 267
if [ -x ${DEVPATH}/${PLATFORM}/${PRE_REBOOT_HOOK} ]; then
debug "Executing the pre-reboot script"
${DEVPATH}/${PLATFORM}/${PRE_REBOOT_HOOK}
fi
Copy link
Collaborator

Choose a reason for hiding this comment

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

If this script fails we might want to abort the reboot operation (unless it is beeing forced).
Also, in case it fails, I wonder whether we should update reboot cause by above if block?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Fixed.
The previous implementation also didn't change the reboot cause if it fails.

scripts/reboot Outdated
if [ -x ${DEVPATH}/${PLATFORM}/${PLAT_REBOOT} ]; then
VERBOSE=yes debug "Rebooting with platform ${PLATFORM} specific tool ..."
${DEVPATH}/${PLATFORM}/${PLAT_REBOOT} $@
${DEVPATH}/${PLATFORM}/${PLAT_REBOOT} ${REBOOT_FLAGS}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd leave it as is, you might break someones flags.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Fixed

@vadymhlushko-mlnx vadymhlushko-mlnx force-pushed the 202305-graceful-shutdown branch 2 times, most recently from fca7356 to a7c2f2e Compare November 30, 2023 10:44
@vadymhlushko-mlnx vadymhlushko-mlnx changed the title internal 202305 graceful shutdown internal [202305] Add the pre_reboot_hook execution, add the watchdog arm before the reboot Dec 4, 2023
@vadymhlushko-mlnx vadymhlushko-mlnx changed the title internal [202305] Add the pre_reboot_hook execution, add the watchdog arm before the reboot internal [202305] Add the pre_reboot_hook script execution, add the watchdog arm before the reboot Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants