diff options
| author | John Crispin | 2016-05-15 14:18:41 +0000 |
|---|---|---|
| committer | John Crispin | 2016-05-15 14:22:52 +0000 |
| commit | a1a1d1c6cf0ae302f76bc39a3d83aba66aee3228 (patch) | |
| tree | 03a1791f189bf802e9262ccd20983012483a6695 | |
| parent | b12bb150ed38a4409bef5127c77b060ee616b860 (diff) | |
| download | procd-a1a1d1c6cf0ae302f76bc39a3d83aba66aee3228.tar.gz | |
preinit: create a sentinel file during preinit
Signed-off-by: John Crispin <john@phrozen.org>
| -rw-r--r-- | initd/preinit.c | 3 |
1 files changed, 3 insertions, 0 deletions
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 <sys/stat.h> #include <sys/types.h> #include <sys/mount.h> +#include <fcntl.h> #include <libubox/uloop.h> #include <libubox/utils.h> @@ -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(); |