← Commit list

373f64eef

Denys Vlasenko
Denys Vlasenko
2023-06-13
SUCCESS Duration: 153s

Subject

syslogd: daemonize _after_ init (so that init errors are visible, if they occur)

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

sysklogd/syslogd.c+8 -8
@@ -1055,6 +1055,14 @@ static int NOINLINE syslogd_init(char **argv)
G.hostname = safe_gethostname();
*strchrnul(G.hostname, '.') = '\0';
+ xmove_fd(create_socket(), STDIN_FILENO);
+
+ if (opts & OPT_circularlog)
+ ipcsyslog_init();
+
+ if (opts & OPT_kmsg)
+ kmsg_init();
+
if (!(opts & OPT_nofork)) {
bb_daemonize_or_rexec(DAEMON_CHDIR_ROOT, argv);
}
@@ -1068,14 +1076,6 @@ static int NOINLINE syslogd_init(char **argv)
signal(SIGALRM, do_mark);
alarm(G.markInterval);
#endif
- xmove_fd(create_socket(), STDIN_FILENO);
-
- if (opts & OPT_circularlog)
- ipcsyslog_init();
-
- if (opts & OPT_kmsg)
- kmsg_init();
-
return opts;
}