mirror of https://github.com/Icinga/icinga2.git
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:
parent
7a7a8c7779
commit
8b742e841f
|
@ -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));
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue