From: John Crispin Date: Sun, 15 May 2016 14:18:41 +0000 (+0200) Subject: preinit: create a sentinel file during preinit X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=a1a1d1c6cf0ae302f76bc39a3d83aba66aee3228;p=project%2Fprocd.git preinit: create a sentinel file during preinit Signed-off-by: John Crispin --- diff --git a/initd/preinit.c b/initd/preinit.c index f38d8ef..51fde31 100644 --- a/initd/preinit.c +++ b/initd/preinit.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -64,6 +65,7 @@ spawn_procd(struct uloop_process *proc, int ret) unsetenv("INITRAMFS"); unsetenv("PREINIT"); + unlink("/tmp/.preinit"); DEBUG(2, "Exec to real procd now\n"); if (wdt_fd) setenv("WDTFD", wdt_fd, 1); @@ -104,6 +106,7 @@ preinit(void) uloop_process_add(&plugd_proc); setenv("PREINIT", "1", 1); + creat("/tmp/.preinit", 0600); preinit_proc.cb = spawn_procd; preinit_proc.pid = fork();