Skip to content

Commit

Permalink
[reboot-cause] Fixed determine-reboot-cause.service failure. (#8210)
Browse files Browse the repository at this point in the history
Signed-off-by: Rajkumar Pennadam Ramamoorthy [email protected]

Why I did it
Install sonic image from ONIE. Once system is up, execute "config reload" command.

Root cause is that "determine-reboot-cause.service" was in failed state.
root@sonic:/host/reboot-cause# systemctl list-units --failed
UNIT LOAD ACTIVE SUB DESCRIPTION
● determine-reboot-cause.service loaded failed failed Reboot cause determination service

How I did it
Fixed the issue by setting default reason to "REBOOT_CAUSE_UNKNOWN" instead of "None".

How to verify it
Check " determine-reboot-cause.service' loaded successfully post image installation from ONIE.
Verify "reboot-cause.txt" file is created and config reload succeeds.
  • Loading branch information
rajkumar38 authored Aug 10, 2021
1 parent 14da7a1 commit d6433d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sonic-host-services/scripts/determine-reboot-cause
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def parse_warmfast_reboot_from_proc_cmdline():


def find_software_reboot_cause_from_reboot_cause_file():
software_reboot_cause = None
software_reboot_cause = REBOOT_CAUSE_UNKNOWN
if os.path.isfile(REBOOT_CAUSE_FILE):
with open(REBOOT_CAUSE_FILE) as cause_file:
software_reboot_cause = cause_file.readline().rstrip('\n')
Expand Down

0 comments on commit d6433d1

Please sign in to comment.