From 33e504b9280589435066415a0db2a91056b42697 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sun, 5 Feb 2023 01:57:40 +0100 Subject: [PATCH] Check if WDT_DEVNODE is defined, may not be enabled in configure When this code was moved from finit.c we rely on WDT_DEVNODE to be defined in config.h, which is controlled by configure. Meaning, before the relocation, Finit did not honor the configure settings. Signed-off-by: Joachim Wiberg --- src/conf.c | 3 ++- src/finit.c | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conf.c b/src/conf.c index 0e906993..89619e84 100644 --- a/src/conf.c +++ b/src/conf.c @@ -1212,11 +1212,12 @@ int conf_init(uev_ctx_t *ctx) /* * Start built-in watchdogd as soon as possible, if enabled */ +#ifdef WDT_DEVNODE if (whichp(FINIT_LIBPATH_ "/watchdogd") && fexist(WDT_DEVNODE)) { service_register(SVC_TYPE_SERVICE, "[S123456789] cgroup.init name:watchdog :finit " FINIT_LIBPATH_ "/watchdogd -- Finit watchdog daemon", global_rlimit, NULL); wdog = svc_find("watchdog", "finit"); } - +#endif /* * Start kernel event daemon as soon as possible, if enabled */ diff --git a/src/finit.c b/src/finit.c index 640aea63..5ff14cc4 100644 --- a/src/finit.c +++ b/src/finit.c @@ -59,7 +59,6 @@ #include "util.h" #include "utmp-api.h" #include "schedule.h" -#include "watchdog.h" int runlevel = 0; /* Bootstrap 'S' */ int cfglevel = RUNLEVEL; /* Fallback if no configured runlevel */