Ensure that obsolete comment/downtime objects are deleted after activating objects

Config validation shouldn't be able to purge the files, only on
restart.

fixes #11890
This commit is contained in:
Michael Friedrich 2016-06-03 14:16:52 +02:00 committed by Gunnar Beutner
parent 7a7a8c7779
commit 8b742e841f
2 changed files with 4 additions and 4 deletions

View File

@ -20,6 +20,7 @@
#include "cli/daemoncommand.hpp"
#include "cli/daemonutility.hpp"
#include "remote/apilistener.hpp"
#include "remote/configobjectutility.hpp"
#include "config/configcompiler.hpp"
#include "config/configcompilercontext.hpp"
#include "config/configitembuilder.hpp"
@ -296,6 +297,9 @@ int DaemonCommand::Run(const po::variables_map& vm, const std::vector<std::strin
Logger::DisableConsoleLog();
}
/* Remove ignored Downtime/Comment objects. */
ConfigItem::RemoveIgnoredItems(ConfigObjectUtility::GetConfigDir());
#ifndef _WIN32
struct sigaction sa;
memset(&sa, 0, sizeof(sa));

View File

@ -24,7 +24,6 @@
#include "config/configcompiler.hpp"
#include "config/configcompilercontext.hpp"
#include "config/configitembuilder.hpp"
#include "remote/configobjectutility.hpp"
using namespace icinga;
@ -169,9 +168,6 @@ bool DaemonUtility::LoadConfigFiles(const std::vector<std::string>& configs,
WorkQueue upq(25000, Application::GetConcurrency());
bool result = ConfigItem::CommitItems(ascope.GetContext(), upq, newItems);
/* Remove ignored Downtime/Comment objects. */
ConfigItem::RemoveIgnoredItems(ConfigObjectUtility::GetConfigDir());
if (!result)
return false;