X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fprocd.git;a=blobdiff_plain;f=initd%2Finit.c;h=9818c4fbe5912308d844927d884746aad859806e;hp=d8490f8505c09a08857464386593ad5f5a40cf2a;hb=4bccbfa967d756b8c84a62ea4752e936d8545a73;hpb=79872ea6ca5867631c1ec5405721af12bea818b2 diff --git a/initd/init.c b/initd/init.c index d8490f8..9818c4f 100644 --- a/initd/init.c +++ b/initd/init.c @@ -72,6 +72,8 @@ main(int argc, char **argv) { pid_t pid; + ulog_open(ULOG_KMSG, LOG_DAEMON, "init"); + sigaction(SIGTERM, &sa_shutdown, NULL); sigaction(SIGUSR1, &sa_shutdown, NULL); sigaction(SIGUSR2, &sa_shutdown, NULL); @@ -99,10 +101,18 @@ main(int argc, char **argv) ERROR("Failed to start kmodloader\n"); exit(-1); } - if (pid <= 0) + if (pid <= 0) { ERROR("Failed to start kmodloader instance\n"); - else - waitpid(pid, NULL, 0); + } else { + int i; + + for (i = 0; i < 120; i++) { + if (waitpid(pid, NULL, WNOHANG) > 0) + break; + sleep(1); + watchdog_ping(); + } + } uloop_init(); preinit(); uloop_run();