From 23461f1ef5342996d5ed55cc379fc49621b9932f Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Sun, 3 May 2020 12:00:35 +0200 Subject: [PATCH] Track built-in watchdogd immediately after registering it Signed-off-by: Joachim Nilsson --- src/finit.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/finit.c b/src/finit.c index 4d2bc9f6..efa5f3a9 100644 --- a/src/finit.c +++ b/src/finit.c @@ -189,15 +189,6 @@ static void emergency_shell(void) */ static void finalize(void) { - svc_t *svc; - - /* - * Track bundled watchdogd in case a better one turns up - */ - svc = svc_find(FINIT_LIBPATH_ "/watchdogd", "1"); - if (svc) - wdog = svc; - /* * Run startup scripts in the runparts directory, if any. */ @@ -514,8 +505,10 @@ int main(int argc, char *argv[]) /* * Start bundled watchdogd as soon as possible, if enabled */ - if (which(FINIT_LIBPATH_ "/watchdogd")) + if (which(FINIT_LIBPATH_ "/watchdogd")) { service_register(SVC_TYPE_SERVICE, FINIT_LIBPATH_ "/watchdogd -- Finit watchdog daemon", global_rlimit, NULL); + wdog = svc_find(FINIT_LIBPATH_ "/watchdogd", NULL); + } if (!rescue) { _d("Root FS up, calling hooks ...");