]> granicus.if.org Git - icinga2/commitdiff
Add debug logging for daemonize/timers 6457/head
authorMichael Friedrich <michael.friedrich@icinga.com>
Thu, 19 Jul 2018 11:34:12 +0000 (13:34 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Thu, 19 Jul 2018 11:34:12 +0000 (13:34 +0200)
The previous commit is 1:1 the same I've implemented
here already. Great teamwork with Alex :)

refs #6445

lib/base/application.cpp
lib/base/timer.cpp
lib/cli/daemoncommand.cpp

index cfa728caabe2661c1b358875132b86fcd68a7864..4287c76879f5de539f109781a18336714f664ebf 100644 (file)
@@ -138,9 +138,10 @@ void Application::InitializeBase()
 
        Loader::ExecuteDeferredInitializers();
 
-       /* make sure the thread pool gets initialized */
+       /* Make sure the thread pool gets initialized. */
        GetTP().Start();
 
+       /* Make sure the timer thread gets initialized. */
        Timer::Initialize();
 }
 
@@ -302,7 +303,6 @@ void Application::SetArgV(char **argv)
  */
 void Application::RunEventLoop()
 {
-
 #ifdef HAVE_SYSTEMD
        sd_notify(0, "READY=1");
 #endif /* HAVE_SYSTEMD */
index 95e3f5b6de21bfd7527425b91e4f96fce498560d..65c7ee6266b099bfa4a7581eeb25af3f506bc283 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "base/timer.hpp"
 #include "base/debug.hpp"
+#include "base/logger.hpp"
 #include "base/utility.hpp"
 #include <boost/thread/mutex.hpp>
 #include <boost/thread/condition_variable.hpp>
@@ -259,6 +260,8 @@ void Timer::AdjustTimers(double adjustment)
  */
 void Timer::TimerThreadProc()
 {
+       Log(LogDebug, "Timer", "TimerThreadProc started.");
+
        Utility::SetThreadName("Timer Thread");
 
        for (;;) {
index f663d10465f887095323af9839dcce7b9aeca76c..ba2dade47656659076ab13c97684f24f2c52d574 100644 (file)
@@ -88,6 +88,9 @@ static bool Daemonize()
                _exit(EXIT_SUCCESS);
        }
 
+       Log(LogDebug, "Daemonize()")
+               << "Child process with PID " << Utility::GetPid() << " continues; re-initializing base.";
+
        Application::InitializeBase();
 #endif /* _WIN32 */