diff --git a/lib/remote/consolehandler.cpp b/lib/remote/consolehandler.cpp index 9490d2420fa..a70e2b3473e 100644 --- a/lib/remote/consolehandler.cpp +++ b/lib/remote/consolehandler.cpp @@ -6,6 +6,7 @@ #include "remote/httputility.hpp" #include "remote/filterutility.hpp" #include "config/configcompiler.hpp" +#include "base/application.hpp" #include "base/configwriter.hpp" #include "base/scriptglobal.hpp" #include "base/logger.hpp" @@ -104,8 +105,7 @@ bool ConsoleHandler::HandleRequest( bool sandboxed = HttpUtility::GetLastParameter(params, "sandboxed"); ConfigObjectsSharedLock lock (std::try_to_lock); - - if (!lock) { + if (!lock || Application::IsRestarting() || Application::IsShuttingDown()) { HttpUtility::SendJsonError(response, params, 503, "Icinga is reloading."); return true; }