From 177f930375330ad762070c6da084ca19d53946b2 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Wed, 23 Sep 2020 11:49:13 +0200 Subject: [PATCH] Call Process::InitializeSpawnHelper() ASAP refs #8196 --- lib/cli/daemoncommand.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/cli/daemoncommand.cpp b/lib/cli/daemoncommand.cpp index 090bb0257..29a73c89c 100644 --- a/lib/cli/daemoncommand.cpp +++ b/lib/cli/daemoncommand.cpp @@ -11,6 +11,7 @@ #include "base/defer.hpp" #include "base/logger.hpp" #include "base/application.hpp" +#include "base/process.hpp" #include "base/timer.hpp" #include "base/utility.hpp" #include "base/exception.hpp" @@ -504,6 +505,14 @@ static pid_t StartUnixWorker(const std::vector& configs, bool close _exit(EXIT_FAILURE); } + try { + Process::InitializeSpawnHelper(); + } catch (const std::exception& ex) { + Log(LogCritical, "cli") + << "Failed to initialize process spawn helper after forking (child): " << DiagnosticInformation(ex); + _exit(EXIT_FAILURE); + } + _exit(RunWorker(configs, closeConsoleLog, stderrFile)); } catch (...) { _exit(EXIT_FAILURE);