From d6433d1adca2d04d0d2bb30e7ccf07355d6922be Mon Sep 17 00:00:00 2001 From: Rajkumar-Marvell <54936542+rajkumar38@users.noreply.github.com> Date: Tue, 10 Aug 2021 23:52:09 +0530 Subject: [PATCH] [reboot-cause] Fixed determine-reboot-cause.service failure. (#8210) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rajkumar Pennadam Ramamoorthy rpennadamram@marvell.com 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. --- src/sonic-host-services/scripts/determine-reboot-cause | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-host-services/scripts/determine-reboot-cause b/src/sonic-host-services/scripts/determine-reboot-cause index ac304a06a0..1408ad0e29 100755 --- a/src/sonic-host-services/scripts/determine-reboot-cause +++ b/src/sonic-host-services/scripts/determine-reboot-cause @@ -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')