mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-26 07:04:37 +02:00
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/daemoncommand.hpp"
|
||||||
#include "cli/daemonutility.hpp"
|
#include "cli/daemonutility.hpp"
|
||||||
#include "remote/apilistener.hpp"
|
#include "remote/apilistener.hpp"
|
||||||
|
#include "remote/configobjectutility.hpp"
|
||||||
#include "config/configcompiler.hpp"
|
#include "config/configcompiler.hpp"
|
||||||
#include "config/configcompilercontext.hpp"
|
#include "config/configcompilercontext.hpp"
|
||||||
#include "config/configitembuilder.hpp"
|
#include "config/configitembuilder.hpp"
|
||||||
@ -296,6 +297,9 @@ int DaemonCommand::Run(const po::variables_map& vm, const std::vector<std::strin
|
|||||||
Logger::DisableConsoleLog();
|
Logger::DisableConsoleLog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Remove ignored Downtime/Comment objects. */
|
||||||
|
ConfigItem::RemoveIgnoredItems(ConfigObjectUtility::GetConfigDir());
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
struct sigaction sa;
|
struct sigaction sa;
|
||||||
memset(&sa, 0, sizeof(sa));
|
memset(&sa, 0, sizeof(sa));
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
#include "config/configcompiler.hpp"
|
#include "config/configcompiler.hpp"
|
||||||
#include "config/configcompilercontext.hpp"
|
#include "config/configcompilercontext.hpp"
|
||||||
#include "config/configitembuilder.hpp"
|
#include "config/configitembuilder.hpp"
|
||||||
#include "remote/configobjectutility.hpp"
|
|
||||||
|
|
||||||
|
|
||||||
using namespace icinga;
|
using namespace icinga;
|
||||||
@ -169,9 +168,6 @@ bool DaemonUtility::LoadConfigFiles(const std::vector<std::string>& configs,
|
|||||||
WorkQueue upq(25000, Application::GetConcurrency());
|
WorkQueue upq(25000, Application::GetConcurrency());
|
||||||
bool result = ConfigItem::CommitItems(ascope.GetContext(), upq, newItems);
|
bool result = ConfigItem::CommitItems(ascope.GetContext(), upq, newItems);
|
||||||
|
|
||||||
/* Remove ignored Downtime/Comment objects. */
|
|
||||||
ConfigItem::RemoveIgnoredItems(ConfigObjectUtility::GetConfigDir());
|
|
||||||
|
|
||||||
if (!result)
|
if (!result)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user