Track built-in watchdogd immediately after registering it

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2020-05-03 12:00:35 +02:00
parent 3b63946973
commit 23461f1ef5
+3 -10
View File
@@ -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 ...");