From 5bef843f690cfd029038433a8bd21cfceba7a96b Mon Sep 17 00:00:00 2001 From: anamehra Date: Wed, 22 Nov 2023 21:44:24 -0800 Subject: [PATCH] Fixed determine/process reboot-cause service dependency Signed-off-by: anamehra --- ...sonic-host-services-data.determine-reboot-cause.service | 7 ++++--- .../sonic-host-services-data.process-reboot-cause.service | 3 ++- .../sonic-host-services-data.process-reboot-cause.timer | 2 ++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/data/debian/sonic-host-services-data.determine-reboot-cause.service b/data/debian/sonic-host-services-data.determine-reboot-cause.service index e834b933..462f8b48 100644 --- a/data/debian/sonic-host-services-data.determine-reboot-cause.service +++ b/data/debian/sonic-host-services-data.determine-reboot-cause.service @@ -1,12 +1,13 @@ [Unit] Description=Reboot cause determination service -Requires=rc-local.service database.service -After=rc-local.service database.service +Requires=rc-local.service +After=rc-local.service +ConditionPathExists=!/tmp/determine-reboot-cause [Service] Type=oneshot RemainAfterExit=yes ExecStart=/usr/local/bin/determine-reboot-cause - +ExecStartPost=/usr/bin/touch /tmp/determine-reboot-cause [Install] WantedBy=multi-user.target diff --git a/data/debian/sonic-host-services-data.process-reboot-cause.service b/data/debian/sonic-host-services-data.process-reboot-cause.service index 14af8868..ef0cb81f 100644 --- a/data/debian/sonic-host-services-data.process-reboot-cause.service +++ b/data/debian/sonic-host-services-data.process-reboot-cause.service @@ -1,8 +1,9 @@ [Unit] Description=Retrieve the reboot cause from the history files and save them to StateDB -Requires=database.service determine-reboot-cause.service +Requires=database.service After=database.service determine-reboot-cause.service [Service] Type=simple +RemainAfterExit=yes ExecStart=/usr/local/bin/process-reboot-cause diff --git a/data/debian/sonic-host-services-data.process-reboot-cause.timer b/data/debian/sonic-host-services-data.process-reboot-cause.timer index 222c51a7..2b28448f 100644 --- a/data/debian/sonic-host-services-data.process-reboot-cause.timer +++ b/data/debian/sonic-host-services-data.process-reboot-cause.timer @@ -1,7 +1,9 @@ [Unit] Description=Delays process-reboot-cause until network is stably connected +PartOf=process-reboot-cause.service [Timer] +OnUnitActiveSec=0 sec OnBootSec=1min 30 sec Unit=process-reboot-cause.service