watchdog: Isolate the watchdog from jobs
[src/app-framework-binder.git] / src / main-afb-daemon.c
index 0a8e018..beb08d3 100644 (file)
@@ -66,6 +66,7 @@
 #include "wrap-json.h"
 #include "jobs.h"
 #include "sig-monitor.h"
+#include "watchdog.h"
 
 #if !defined(DEFAULT_BINDER_INTERFACE)
 #  define DEFAULT_BINDER_INTERFACE NULL
@@ -861,6 +862,13 @@ static void start(int signum, void *arg)
 
        /* ready */
        sd_notify(1, "READY=1");
+
+       /* activate the watchdog */
+#if HAS_WATCHDOG
+       if (watchdog_activate() < 0)
+               ERROR("can't start the watchdog");
+#endif
+
        return;
 error:
        exit(1);