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

[graceful reboot] Add the pre_reboot_hook script execution, add the watchdog arm before the reboot #3203

Merged
merged 1 commit into from
Mar 19, 2024

Conversation

vadymhlushko-mlnx
Copy link
Contributor

@vadymhlushko-mlnx vadymhlushko-mlnx commented Mar 11, 2024

DEPENDS ON: [graceful reboot] Rename the platform_reboot to the pre_reboot_hook, remove the sysfs power cycle #18324

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)

…atchdog arm before the reboot

Signed-off-by: vadymhlushko-mlnx <vadymh@nvidia.com>
@@ -242,6 +253,23 @@ if [ -x ${DEVPATH}/${PLATFORM}/${PLATFORM_UPDATE_REBOOT_CAUSE} ]; then
${DEVPATH}/${PLATFORM}/${PLATFORM_UPDATE_REBOOT_CAUSE}
fi

if [ -x ${DEVPATH}/${PLATFORM}/${PRE_REBOOT_HOOK} ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

@vadymhlushko-mlnx why do we need pre_reboot_hook?

Copy link
Contributor Author

@vadymhlushko-mlnx vadymhlushko-mlnx Mar 11, 2024

Choose a reason for hiding this comment

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

@prgeor this PR comes in bundle [graceful reboot] Rename the platform_reboot to the pre_reboot_hook, remove the sysfs power cycle #18324.

For MLNX we removed the sysfs power cycle from the platform_reboot script and because the platform_reboot is no longer doing any reboot, we decided to rename it from platform_reboot to pre_reboot_hook

@prgeor prgeor merged commit d4688a8 into sonic-net:master Mar 19, 2024
5 checks passed
qiluo-msft pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Mar 23, 2024
…remove the sysfs power cycle (#18324)

**DEPENDS ON: [[graceful reboot] Add the pre_reboot_hook script execution, add the watchdog arm before the reboot](sonic-net/sonic-utilities#3203

#### Why I did it
Add support for the `graceful reboot` instead of  the `sysfs power cycle` to avoid filesystem corruption 

### How I did it
Rename the `platform_reboot` script to the `pre_reboot_hook`.
Remove the sysfs power cycle function, from now on the Debian reboot (`/sbin/reboot`) will be executed instead of the sysfs power cycle.

#### 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
arfeigin pushed a commit to arfeigin/sonic-utilities that referenced this pull request Apr 2, 2024
…atchdog arm before the reboot (sonic-net#3203)

Signed-off-by: vadymhlushko-mlnx <vadymh@nvidia.com>
liat-grozovik pushed a commit that referenced this pull request Sep 3, 2024
- What I did
Add back the support to call reboot -f
The support for this option was accidentally removed as part of this PR #3203
The same PR for 202311 doesn't have this mistake - #3204

- How I did it

- How to verify it
Call reboot -f
mssonicbld pushed a commit to mssonicbld/sonic-utilities that referenced this pull request Sep 6, 2024
- What I did
Add back the support to call reboot -f
The support for this option was accidentally removed as part of this PR sonic-net#3203
The same PR for 202311 doesn't have this mistake - sonic-net#3204

- How I did it

- How to verify it
Call reboot -f
mssonicbld pushed a commit that referenced this pull request Sep 6, 2024
- What I did
Add back the support to call reboot -f
The support for this option was accidentally removed as part of this PR #3203
The same PR for 202311 doesn't have this mistake - #3204

- How I did it

- How to verify it
Call reboot -f
jianyuewu pushed a commit to jianyuewu/sonic-utilities that referenced this pull request Feb 7, 2025
- What I did
Add back the support to call reboot -f
The support for this option was accidentally removed as part of this PR sonic-net#3203
The same PR for 202311 doesn't have this mistake - sonic-net#3204

- How I did it

- How to verify it
Call reboot -f
jianyuewu pushed a commit to jianyuewu/sonic-utilities that referenced this pull request Feb 7, 2025
- What I did
Add back the support to call reboot -f
The support for this option was accidentally removed as part of this PR sonic-net#3203
The same PR for 202311 doesn't have this mistake - sonic-net#3204

- How I did it

- How to verify it
Call reboot -f
jianyuewu pushed a commit to jianyuewu/sonic-utilities that referenced this pull request Feb 8, 2025
…atchdog arm before the reboot (sonic-net#3203)

Signed-off-by: vadymhlushko-mlnx <vadymh@nvidia.com>
jianyuewu pushed a commit to jianyuewu/sonic-utilities that referenced this pull request Feb 8, 2025
- What I did
Add back the support to call reboot -f
The support for this option was accidentally removed as part of this PR sonic-net#3203
The same PR for 202311 doesn't have this mistake - sonic-net#3204

- How I did it

- How to verify it
Call reboot -f

Signed-off-by: Jianyue Wu <jianyuew@nvidia.com>
jianyuewu pushed a commit to jianyuewu/sonic-utilities that referenced this pull request Feb 10, 2025
- What I did
Add back the support to call reboot -f
The support for this option was accidentally removed as part of this PR sonic-net#3203
The same PR for 202311 doesn't have this mistake - sonic-net#3204

- How I did it

- How to verify it
Call reboot -f
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