-
Notifications
You must be signed in to change notification settings - Fork 667
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
reboot mechanism enhanced with reboot cause #3154
Open
shyam77git
wants to merge
2
commits into
sonic-net:master
Choose a base branch
from
shyam77git:shyakuma/reboot-enhancement
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
reboot mechanism enhanced with reboot cause #3154
shyam77git
wants to merge
2
commits into
sonic-net:master
from
shyam77git:shyakuma/reboot-enhancement
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Prior to this change, reboot script is only externally trigged where reboot cause is always fixed i.e. (default's to user issued reboot command) - In this PR (changeset), SONiC reboot is enhanced to accept reboot cause (reason) as an option (argument) - This would enable system applications' (e.g. Fault Manager) to pass reboot cause as an argument while initiating (system level) reboot - This reboot cause in turn is saved to REBOOT_CAUSE_FILE for tracking and debugging purposes Signed-off-by: Shyam Kumar <shyakuma@cisco.com>
This was referenced Feb 7, 2024
amulyan7
reviewed
Feb 13, 2024
amulyan7
reviewed
Feb 13, 2024
amulyan7
reviewed
Feb 13, 2024
amulyan7
reviewed
Feb 13, 2024
amulyan7
reviewed
Feb 13, 2024
- Addressed PR review comments Signed-off-by: Shyam Kumar <shyakuma@cisco.com>
UT test scenario and logs: |
LGTM |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What I did
How I did it
How to verify it
Refer to UT scenarios and logs:
UT-reboot.txt
root@sonic:/home/cisco# reboot -h
Usage /usr/local/bin/reboot [options]
Request rebooting the device. Invoke platform-specific tool when available.
This script will shutdown syncd before rebooting.
root@sonic:/home/cisco#
root@sonic:/home/cisco# reboot -r "rebooting due to xyz reason"
reboot_cause: rebooting due to xyz reason
requested COLD shutdown
/var/log: 0 B (0 bytes) trimmed on /dev/loop1
/host: 204.6 MiB (214548480 bytes) trimmed on /dev/sda3
Tue 06 Feb 2024 06:20:22 AM UTC Issuing OS-level reboot ...
Going to issue reboot command...
reboot cause specified
root@sonic:/home/cisco#
root@sonic:/home/cisco# show reboot-cause history
Name Cause
2024_02_06_06_23_30 System triggered reboot. reason: 'rebooting due to xyz reason' [User: system, Time: Tue 06 Feb 2024 06:20:13 AM UTC]
2024_02_06_01_07_29 reboot Tue 06 Feb 2024 01:04:43 AM UTC
Previous command output (if the output of a command-line utility has changed)
root@sonic:/home/cisco# reboot
requested COLD shutdown
/var/log: 0 B (0 bytes) trimmed on /dev/loop1
/host: 204.6 MiB (214548480 bytes) trimmed on /dev/sda3
Tue 06 Feb 2024 06:20:22 AM UTC Issuing OS-level reboot ...
root@sonic:/home/cisco#
New command output (if the output of a command-line utility has changed)
Note: Above-mentioned default 'reboot' command is kept intact.
Additional (optional) argument -r, if passed to the reboot, would have following outcome:
root@sonic:/home/cisco# reboot -r "rebooting due to xyz reason"
reboot_cause: rebooting due to xyz reason
requested COLD shutdown
/var/log: 0 B (0 bytes) trimmed on /dev/loop1
/host: 204.6 MiB (214548480 bytes) trimmed on /dev/sda3
Tue 06 Feb 2024 06:20:22 AM UTC Issuing OS-level reboot ...
Going to issue reboot command...
reboot cause specified
root@sonic:/home/cisco#