Add another constraint for the built-in watchdog, device exists

- Check if watchdogd *and* `WDT_DEVNODE` exists before registering the
   built-in watchdogd at boot
 - Update bootstrap.md with this additional constraint
 - Update config.md with references to bootstrap and the new constraint

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2021-04-24 10:33:57 +02:00
1 parent 2ea613a42b
commit 6dced29b49
3 files changed
+26 -21

No files matched your search

+2 -1
View File
@@ -52,6 +52,7 @@
#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 */
@@ -552,7 +553,7 @@ int main(int argc, char *argv[])
/*
* Start built-in watchdogd as soon as possible, if enabled
*/
if (which(FINIT_LIBPATH_ "/watchdogd")) {
if (which(FINIT_LIBPATH_ "/watchdogd") && fexist(WDT_DEVNODE)) {
service_register(SVC_TYPE_SERVICE, "[123456789] name:watchdog :finit " FINIT_LIBPATH_ "/watchdogd -- Finit watchdog daemon", global_rlimit, NULL);
wdog = svc_find_by_nameid("watchdog", "finit");
}