Make determine-reboot-cause into oneshot service#12628
Merged
prgeor merged 2 commits intosonic-net:masterfrom Nov 12, 2022
Merged
Make determine-reboot-cause into oneshot service#12628prgeor merged 2 commits intosonic-net:masterfrom
prgeor merged 2 commits intosonic-net:masterfrom
Conversation
Contributor
Author
|
@gechiang Could you check this? |
Collaborator
|
@prgeor , @sujinmkang , @lguohan , Thanks |
prgeor
approved these changes
Nov 12, 2022
Contributor
yxieca
pushed a commit
that referenced
this pull request
Nov 28, 2022
This file contains hidden or 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
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.
Why I did it
"show reboot-cause history" does not report the latest reboot-cause because process-reboot-cause does not wait for determine-reboot-cause to complete running before it starts.
Currently the system just assumes that process-reboot-cause will run after determine-reboot-cause based on timing. This fix is fixing the race condition that might happen if the determine-reboot-cause does not finish before process-reboot-cause.
How I did it
This PR makes determine-reboot-cause.service into a oneshot service to ensure process-reboot-cause only runs once determine-reboot-cause completes.
This fix depends on a PR for process-reboot-cause.service dependency, which needs to be committed to 202205 branch.
#11213
How to verify it
Run "show reboot-cause" and "show reboot-cause history"
The latest entry in reboot-cause history should match the output of show reboot-cause.
Can check the journal logs of determine-reboot-cause.service and process-reboot-cause.service after a reboot to confirm that process-reboot-cause only runs after determine-reboot cause.
Which release branch to backport (provide reason below if selected)
Description for the changelog
Update determine-reboot-cause.service to be oneshot service to ensure it completes before process-reboot-cause.service runs
Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU.
Link to config_db schema for YANG module changes