diff --git a/lib/cli/daemoncommand.cpp b/lib/cli/daemoncommand.cpp index 28fce401df0..a4df1af8102 100644 --- a/lib/cli/daemoncommand.cpp +++ b/lib/cli/daemoncommand.cpp @@ -437,7 +437,17 @@ static pid_t StartUnixWorker(const std::vector& 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 {