From 4d6088bee11a3ded121b5086d9b870425ce64681 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Mon, 17 Mar 2014 09:04:19 +0100 Subject: [PATCH] Stop checks during shutdown. Fixes #5784 --- components/checker/checkercomponent.cpp | 3 +++ etc/init.d/icinga2.cmake | 2 +- lib/base/application.cpp | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/components/checker/checkercomponent.cpp b/components/checker/checkercomponent.cpp index 2d3bbff77..bba18211d 100644 --- a/components/checker/checkercomponent.cpp +++ b/components/checker/checkercomponent.cpp @@ -84,12 +84,15 @@ void CheckerComponent::Start(void) void CheckerComponent::Stop(void) { + Log(LogInformation, "checker", "Checker stopped."); + { boost::mutex::scoped_lock lock(m_Mutex); m_Stopped = true; m_CV.notify_all(); } + m_ResultTimer->Stop(); m_Thread.join(); } diff --git a/etc/init.d/icinga2.cmake b/etc/init.d/icinga2.cmake index e550dc272..d771289cc 100644 --- a/etc/init.d/icinga2.cmake +++ b/etc/init.d/icinga2.cmake @@ -87,7 +87,7 @@ stop() { printf '.' - sleep 1 + sleep 3 done fi diff --git a/lib/base/application.cpp b/lib/base/application.cpp index 2d956a3ee..df6ebc0b4 100644 --- a/lib/base/application.cpp +++ b/lib/base/application.cpp @@ -174,10 +174,10 @@ void Application::RunEventLoop(void) const Utility::Sleep(0.5); Log(LogInformation, "base", "Shutting down Icinga..."); + DynamicObject::StopObjects(); Application::GetInstance()->OnShutdown(); #ifdef _DEBUG - DynamicObject::StopObjects(); GetTP().Stop(); m_ShuttingDown = false;