Skip to content

Commit

Permalink
Merge branch 'bugfix/fork-exit' into feature/icinga-check-output-erro…
Browse files Browse the repository at this point in the history
…r-last-reload-failed-7263
  • Loading branch information
Al2Klimov committed Oct 30, 2020
2 parents 0af2a51 + 96ee6f1 commit 2005e4b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/cli/daemoncommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,17 @@ static pid_t StartUnixWorker(const std::vector<std::string>& configs, bool close
case -1:
Log(LogCritical, "cli")
<< "fork() failed with error code " << errno << ", \"" << Utility::FormatErrorNumber(errno) << "\"";
exit(EXIT_FAILURE);

try {
Application::InitializeBase();
} catch (const std::exception& ex) {
Log(LogCritical, "cli")
<< "Failed to re-initialize thread pool after forking (parent): " << DiagnosticInformation(ex);
exit(EXIT_FAILURE);
}

(void)sigprocmask(SIG_UNBLOCK, &l_UnixWorkerSignals, nullptr);
return -1;

case 0:
try {
Expand Down

0 comments on commit 2005e4b

Please sign in to comment.