projects
/
project
/
procd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
init: add support for sysupgrades triggered from preinit
[project/procd.git]
/
initd
/
init.c
diff --git
a/initd/init.c
b/initd/init.c
index
0d201bc
..
e453cff
100644
(file)
--- a/
initd/init.c
+++ b/
initd/init.c
@@
-72,6
+72,8
@@
main(int argc, char **argv)
{
pid_t pid;
{
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);
sigaction(SIGTERM, &sa_shutdown, NULL);
sigaction(SIGUSR1, &sa_shutdown, NULL);
sigaction(SIGUSR2, &sa_shutdown, NULL);
@@
-84,17
+86,9
@@
main(int argc, char **argv)
if (!pid) {
char *kmod[] = { "/sbin/kmodloader", "/etc/modules-boot.d/", NULL };
if (!pid) {
char *kmod[] = { "/sbin/kmodloader", "/etc/modules-boot.d/", NULL };
- if (debug < 3)
{
-
int fd = open("/dev/null", O_RDWR
);
+ if (debug < 3)
+
patch_stdio("/dev/null"
);
- if (fd > -1) {
- dup2(fd, STDIN_FILENO);
- dup2(fd, STDOUT_FILENO);
- dup2(fd, STDERR_FILENO);
- if (fd > STDERR_FILENO)
- close(fd);
- }
- }
execvp(kmod[0], kmod);
ERROR("Failed to start kmodloader\n");
exit(-1);
execvp(kmod[0], kmod);
ERROR("Failed to start kmodloader\n");
exit(-1);
@@
-104,10
+98,10
@@
main(int argc, char **argv)
} else {
int i;
} else {
int i;
- for (i = 0; i < 120; i++) {
+ for (i = 0; i < 120
0
; i++) {
if (waitpid(pid, NULL, WNOHANG) > 0)
break;
if (waitpid(pid, NULL, WNOHANG) > 0)
break;
-
sleep(1
);
+
usleep(10 * 1000
);
watchdog_ping();
}
}
watchdog_ping();
}
}