From 9687e27c389c6a6455159a12c76e7f23700f5ada Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 18 May 2016 12:53:41 +0200 Subject: [PATCH 1/4] Fix crash in ConfigItem::Commit fixes #11804 --- lib/config/configitem.cpp | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/lib/config/configitem.cpp b/lib/config/configitem.cpp index 580bb97f3..e26263a0c 100644 --- a/lib/config/configitem.cpp +++ b/lib/config/configitem.cpp @@ -194,7 +194,10 @@ ConfigObject::Ptr ConfigItem::Commit(bool discard) Log(LogNotice, "ConfigObject") << "Ignoring config object '" << m_Name << "' of type '" << m_Type << "' due to errors: " << DiagnosticInformation(ex); - m_IgnoredItems.push_back(m_DebugInfo.Path); + { + boost::mutex::scoped_lock lock(m_Mutex); + m_IgnoredItems.push_back(m_DebugInfo.Path); + } return ConfigObject::Ptr(); } @@ -243,7 +246,10 @@ ConfigObject::Ptr ConfigItem::Commit(bool discard) Log(LogNotice, "ConfigObject") << "Ignoring config object '" << m_Name << "' of type '" << m_Type << "' due to errors: " << DiagnosticInformation(ex); - m_IgnoredItems.push_back(m_DebugInfo.Path); + { + boost::mutex::scoped_lock lock(m_Mutex); + m_IgnoredItems.push_back(m_DebugInfo.Path); + } return ConfigObject::Ptr(); } @@ -259,7 +265,10 @@ ConfigObject::Ptr ConfigItem::Commit(bool discard) Log(LogNotice, "ConfigObject") << "Ignoring config object '" << m_Name << "' of type '" << m_Type << "' due to errors: " << DiagnosticInformation(ex); - m_IgnoredItems.push_back(m_DebugInfo.Path); + { + boost::mutex::scoped_lock lock(m_Mutex); + m_IgnoredItems.push_back(m_DebugInfo.Path); + } return ConfigObject::Ptr(); } @@ -374,7 +383,10 @@ void ConfigItem::OnAllConfigLoadedHelper(void) Unregister(); - m_IgnoredItems.push_back(m_DebugInfo.Path); + { + boost::mutex::scoped_lock lock(m_Mutex); + m_IgnoredItems.push_back(m_DebugInfo.Path); + } return; } @@ -645,6 +657,8 @@ std::vector ConfigItem::GetItems(const String& type) void ConfigItem::RemoveIgnoredItems(const String& allowedConfigPath) { + boost::mutex::scoped_lock lock(m_Mutex); + BOOST_FOREACH(const String& path, m_IgnoredItems) { if (path.Find(allowedConfigPath) == String::NPos) continue; From 0e76876228fadda025b0e1ac4b82e37b96f384e9 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 18 May 2016 14:01:32 +0200 Subject: [PATCH 2/4] Fix exception in PerfdataWriter::RotateFile fixes #11801 --- lib/perfdata/perfdatawriter.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/perfdata/perfdatawriter.cpp b/lib/perfdata/perfdatawriter.cpp index 7760045ec..304ce2605 100644 --- a/lib/perfdata/perfdatawriter.cpp +++ b/lib/perfdata/perfdatawriter.cpp @@ -123,12 +123,14 @@ void PerfdataWriter::RotateFile(std::ofstream& output, const String& temp_path, if (output.good()) { output.close(); - String finalFile = perfdata_path + "." + Convert::ToString((long)Utility::GetTime()); - if (rename(temp_path.CStr(), finalFile.CStr()) < 0) { - BOOST_THROW_EXCEPTION(posix_error() - << boost::errinfo_api_function("rename") - << boost::errinfo_errno(errno) - << boost::errinfo_file_name(temp_path)); + if (Utility::PathExists(temp_path)) { + String finalFile = perfdata_path + "." + Convert::ToString((long)Utility::GetTime()); + if (rename(temp_path.CStr(), finalFile.CStr()) < 0) { + BOOST_THROW_EXCEPTION(posix_error() + << boost::errinfo_api_function("rename") + << boost::errinfo_errno(errno) + << boost::errinfo_file_name(temp_path)); + } } } From 37463741f1e3daf9ec4d87dcb574940b303e656e Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 18 May 2016 15:52:29 +0200 Subject: [PATCH 3/4] Open the command pipe with O_RDWR fixes #11807 --- lib/compat/externalcommandlistener.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/compat/externalcommandlistener.cpp b/lib/compat/externalcommandlistener.cpp index dcd57eb3f..359800dbf 100644 --- a/lib/compat/externalcommandlistener.cpp +++ b/lib/compat/externalcommandlistener.cpp @@ -94,7 +94,7 @@ void ExternalCommandListener::CommandPipeThread(const String& commandPath) } for (;;) { - int fd = open(commandPath.CStr(), O_RDONLY | O_NONBLOCK); + int fd = open(commandPath.CStr(), O_RDWR | O_NONBLOCK); if (fd < 0) { Log(LogCritical, "ExternalCommandListener") From 597d1c3d89cbc0941be2c5660d8ee368e77fc030 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 19 May 2016 09:55:08 +0200 Subject: [PATCH 4/4] Release version 2.4.9 --- ChangeLog | 12 ++++++++++++ RELEASE.md | 14 +++++++------- doc/1-about.md | 12 ++++++++++++ icinga2.nuspec | 2 +- icinga2.spec | 2 +- tools/chocolateyInstall.ps1 | 4 ++-- 6 files changed, 35 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index fd67558e9..9eec36fb9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,18 @@ Please check [doc/1-about.md]. ## What's New +### What's New in Version 2.4.9 + +#### Changes + +This release fixes a number of issues introduced in 2.4.8. + +#### Bugfixes + +* Bug 11801 (Perfdata): Error: Function call 'rename' for file '/var/spool/icinga2/tmp/service-perfdata' failed with error code 2, 'No such file or directory' +* Bug 11804 (Configuration): Segfault when trying to start 2.4.8 +* Bug 11807 (Compat): Command Pipe thread 100% CPU Usage + ### What's New in Version 2.4.8 #### Changes diff --git a/RELEASE.md b/RELEASE.md index da10b1b64..8d7859ac3 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -12,9 +12,9 @@ Check the following issue filters: ## Backport Commits $ git checkout master - $ ./pick.py -V 2.4.8 + $ ./pick.py -V 2.4.9 -The script creates a new branch 'auto-merged-2.4.8' which is based on the +The script creates a new branch 'auto-merged-2.4.9' which is based on the current support branch. It then merges all commits from the 'master' branch which reference a ticket for the version that was specified. @@ -26,7 +26,7 @@ rebase until no commits are left: After finishing the rebase the branch needs to be merged into the support branch: $ git checkout support/2.4 - $ git merge --ff-only auto-merged-2.4.8 + $ git merge --ff-only auto-merged-2.4.9 ## Authors @@ -50,15 +50,15 @@ the changelog.py script. Also generate HTML for the wordpress release announceme Changelog: - $ ./changelog.py -V 2.4.8 + $ ./changelog.py -V 2.4.9 Docs: - $ ./changelog.py -V 2.4.8 -l + $ ./changelog.py -V 2.4.9 -l Wordpress: - $ ./changelog.py -V 2.4.8 -H -l + $ ./changelog.py -V 2.4.9 -H -l ## Git Tag @@ -141,7 +141,7 @@ Create the nupkg package: Install the created icinga2 package locally: - choco install icinga2 -version 2.4.8 -fdv "%cd%" -source "'%cd%;https://chocolatey.org/api/v2/'" + choco install icinga2 -version 2.4.9 -fdv "%cd%" -source "'%cd%;https://chocolatey.org/api/v2/'" Upload the package to [chocolatey](https://chocolatey.org/packages/upload). diff --git a/doc/1-about.md b/doc/1-about.md index a8e8ad8b8..33c3745cf 100644 --- a/doc/1-about.md +++ b/doc/1-about.md @@ -54,6 +54,18 @@ More details in the [Icinga FAQ](https://www.icinga.org/icinga/faq/). ## What's New +### What's New in Version 2.4.9 + +#### Changes + +This release fixes a number of issues introduced in 2.4.8. + +#### Bugfixes + +* Bug [11801](https://dev.icinga.org/issues/11801 "Bug 11801") (Perfdata): Error: Function call 'rename' for file '/var/spool/icinga2/tmp/service-perfdata' failed with error code 2, 'No such file or directory' +* Bug [11804](https://dev.icinga.org/issues/11804 "Bug 11804") (Configuration): Segfault when trying to start 2.4.8 +* Bug [11807](https://dev.icinga.org/issues/11807 "Bug 11807") (Compat): Command Pipe thread 100% CPU Usage + ### What's New in Version 2.4.8 #### Changes diff --git a/icinga2.nuspec b/icinga2.nuspec index 416a51b39..6ad7e265b 100755 --- a/icinga2.nuspec +++ b/icinga2.nuspec @@ -6,7 +6,7 @@ icinga2 Icinga2 - 2.4.8 + 2.4.9 2016 - The Icinga Project Icinga Development Team icinga2 - Monitoring Agent for Windows diff --git a/icinga2.spec b/icinga2.spec index 445a6f9a2..2ec770909 100644 --- a/icinga2.spec +++ b/icinga2.spec @@ -66,7 +66,7 @@ Summary: Network monitoring application Name: icinga2 -Version: 2.4.8 +Version: 2.4.9 Release: %{revision}%{?dist} License: GPL-2.0+ Group: Applications/System diff --git a/tools/chocolateyInstall.ps1 b/tools/chocolateyInstall.ps1 index 034446038..2d0013b33 100755 --- a/tools/chocolateyInstall.ps1 +++ b/tools/chocolateyInstall.ps1 @@ -1,7 +1,7 @@ $packageName = 'icinga2' $installerType = 'msi' -$url32 = 'http://packages.icinga.org/windows/Icinga2-v2.4.8-x86.msi' -$url64 = 'http://packages.icinga.org/windows/Icinga2-v2.4.8-x86_64.msi' +$url32 = 'http://packages.icinga.org/windows/Icinga2-v2.4.9-x86.msi' +$url64 = 'http://packages.icinga.org/windows/Icinga2-v2.4.9-x86_64.msi' $silentArgs = '/qn /norestart' $validExitCodes = @(0)