[pkg-nagios-changes] [Git][nagios-team/pkg-icinga2][upstream] New upstream version 2.9.1

Bas Couwenberg gitlab at salsa.debian.org
Wed Jul 25 05:55:27 BST 2018


Bas Couwenberg pushed to branch upstream at Debian Nagios Maintainer Group / pkg-icinga2


Commits:
14004f10 by Bas Couwenberg at 2018-07-25T06:19:41+02:00
New upstream version 2.9.1
- - - - -


20 changed files:

- AUTHORS
- CHANGELOG.md
- VERSION
- etc/initsystem/icinga2.init.d.cmake
- etc/initsystem/prepare-dirs.cmake
- etc/initsystem/safe-reload.cmake
- lib/base/application.cpp
- lib/base/socket.cpp
- lib/base/timer.cpp
- lib/base/timer.hpp
- lib/checker/checkercomponent.cpp
- lib/cli/daemoncommand.cpp
- lib/cli/nodesetupcommand.cpp
- lib/icinga/checkable-check.cpp
- lib/icinga/checkable-notification.cpp
- lib/icinga/clusterevents-check.cpp
- lib/icinga/notification.cpp
- lib/notification/notificationcomponent.cpp
- third-party/yajl/src/api/yajl_parse.h
- tools/selinux/icinga2.te


Changes:

=====================================
AUTHORS
=====================================
--- a/AUTHORS
+++ b/AUTHORS
@@ -11,6 +11,7 @@ Andrew Meyer <ameyer+secure at nodnetwork.org>
 Andy Grunwald <andygrunwald at gmail.com>
 Arnd Hannemann <arnd at arndnet.de>
 Assaf Flatto <assaf at aikilinux.com>
+Bas Couwenberg <sebastic at xs4all.nl>
 Bastian Guse <bguse at nocopy.de>
 Benedikt Heine <bebe at bebehei.de>
 Bernd Erk <bernd.erk at icinga.com>


=====================================
CHANGELOG.md
=====================================
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,23 @@
 # Icinga 2.x CHANGELOG
 
+## 2.9.1 (2018-07-24)
+
+### Bug
+
+* [#6457](https://github.com/icinga/icinga2/issues/6457) (PR): Ensure that timer thread is initialized after Daemonize\(\)
+* [#6449](https://github.com/icinga/icinga2/issues/6449): icinga r2.9.0-1 init.d script overrides PATH variable
+* [#6445](https://github.com/icinga/icinga2/issues/6445): Problem with daemonize \(init scripts, -d\) on Debian 8 / CentOS 6 / Ubuntu 14 / SLES 11 in 2.9
+* [#6444](https://github.com/icinga/icinga2/issues/6444) (PR): SELinux: allow systemd notify
+* [#6443](https://github.com/icinga/icinga2/issues/6443): selinux and 2.9
+
+### Support
+
+* [#6470](https://github.com/icinga/icinga2/issues/6470) (code-quality, PR): Fix spelling errors.
+* [#6467](https://github.com/icinga/icinga2/issues/6467) (Tests, PR): Start and stop the timer thread lazily
+* [#6461](https://github.com/icinga/icinga2/issues/6461) (Tests): Broken tests with fix from \#6457
+* [#6451](https://github.com/icinga/icinga2/issues/6451) (Packages, PR): Fix initscripts
+* [#6450](https://github.com/icinga/icinga2/issues/6450) (Packages): init script helpers - source: not found
+
 ## 2.9.0 (2018-07-17)
 
 ### Notes


=====================================
VERSION
=====================================
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-Version: 2.9.0
+Version: 2.9.1
 Revision: 1


=====================================
etc/initsystem/icinga2.init.d.cmake
=====================================
--- a/etc/initsystem/icinga2.init.d.cmake
+++ b/etc/initsystem/icinga2.init.d.cmake
@@ -15,6 +15,13 @@
 # Description:       Icinga 2 is a monitoring and management system for hosts, services and networks.
 ### END INIT INFO
 
+# Get function from functions library
+if [ -f /etc/rc.d/init.d/functions ]; then
+	. /etc/rc.d/init.d/functions
+elif [ -f /etc/init.d/functions ]; then
+	. /etc/init.d/functions
+fi
+
 # load system specific defines
 SYSCONFIGFILE=@ICINGA2_SYSCONFIGFILE@
 if [ -f $SYSCONFIGFILE ]; then
@@ -50,13 +57,6 @@ getent passwd $ICINGA2_USER >/dev/null 2>&1 || (echo "Icinga user '$ICINGA2_USER
 getent group $ICINGA2_GROUP >/dev/null 2>&1 || (echo "Icinga group '$ICINGA2_GROUP' does not exist. Exiting." && exit 6)
 getent group $ICINGA2_COMMAND_GROUP >/dev/null 2>&1 || (echo "Icinga command group '$ICINGA2_COMMAND_GROUP' does not exist. Exiting." && exit 6)
 
-# Get function from functions library
-if [ -f /etc/rc.d/init.d/functions ]; then
-	. /etc/rc.d/init.d/functions
-elif [ -f /etc/init.d/functions ]; then
-	. /etc/init.d/functions
-fi
-
 # Start Icinga 2
 start() {
 	printf "Starting Icinga 2: "


=====================================
etc/initsystem/prepare-dirs.cmake
=====================================
--- a/etc/initsystem/prepare-dirs.cmake
+++ b/etc/initsystem/prepare-dirs.cmake
@@ -6,7 +6,7 @@
 # Load sysconf on systems where the initsystem does not pass the environment
 if [ "$1" != "" ]; then
 	if [ -r "$1" ]; then
-		source "$1"
+		. "$1"
 	else
 		echo "Unable to read sysconf from '$1'. Exiting." && exit 6
 	fi


=====================================
etc/initsystem/safe-reload.cmake
=====================================
--- a/etc/initsystem/safe-reload.cmake
+++ b/etc/initsystem/safe-reload.cmake
@@ -3,7 +3,7 @@
 # Load sysconf on systems where the initsystem does not pass the environment
 if [ "$1" != "" ]; then
 	if [ -r "$1" ]; then
-		source "$1"
+		. "$1"
 	else
 		echo "Unable to read sysconf from '$1'. Exiting." && exit 6
 	fi


=====================================
lib/base/application.cpp
=====================================
--- a/lib/base/application.cpp
+++ b/lib/base/application.cpp
@@ -138,8 +138,11 @@ void Application::InitializeBase()
 
 	Loader::ExecuteDeferredInitializers();
 
-	/* make sure the thread pool gets initialized */
+	/* Make sure the thread pool gets initialized. */
 	GetTP().Start();
+
+	/* Make sure the timer thread gets initialized. */
+	Timer::Initialize();
 }
 
 void Application::UninitializeBase()
@@ -300,7 +303,6 @@ void Application::SetArgV(char **argv)
  */
 void Application::RunEventLoop()
 {
-
 #ifdef HAVE_SYSTEMD
 	sd_notify(0, "READY=1");
 #endif /* HAVE_SYSTEMD */


=====================================
lib/base/socket.cpp
=====================================
--- a/lib/base/socket.cpp
+++ b/lib/base/socket.cpp
@@ -94,7 +94,7 @@ void Socket::Close()
 }
 
 /**
- * Retrieves the last error that occured for the socket.
+ * Retrieves the last error that occurred for the socket.
  *
  * @returns An error code.
  */


=====================================
lib/base/timer.cpp
=====================================
--- a/lib/base/timer.cpp
+++ b/lib/base/timer.cpp
@@ -19,6 +19,7 @@
 
 #include "base/timer.hpp"
 #include "base/debug.hpp"
+#include "base/logger.hpp"
 #include "base/utility.hpp"
 #include <boost/thread/mutex.hpp>
 #include <boost/thread/condition_variable.hpp>
@@ -71,7 +72,7 @@ static boost::condition_variable l_TimerCV;
 static std::thread l_TimerThread;
 static bool l_StopTimerThread;
 static TimerSet l_Timers;
-static int l_AliveTimers;
+static int l_AliveTimers = 0;
 
 /**
  * Destructor for the Timer class.
@@ -81,16 +82,43 @@ Timer::~Timer()
 	Stop(true);
 }
 
+void Timer::Initialize()
+{
+	boost::mutex::scoped_lock lock(l_TimerMutex);
+
+	if (l_AliveTimers > 0) {
+		InitializeThread();
+	}
+}
+
 void Timer::Uninitialize()
 {
+	boost::mutex::scoped_lock lock(l_TimerMutex);
+
+	if (l_AliveTimers > 0) {
+		UninitializeThread();
+	}
+}
+
+void Timer::InitializeThread()
+{
+	l_StopTimerThread = false;
+	l_TimerThread = std::thread(&Timer::TimerThreadProc);
+}
+
+void Timer::UninitializeThread()
+{
 	{
-		boost::mutex::scoped_lock lock(l_TimerMutex);
 		l_StopTimerThread = true;
 		l_TimerCV.notify_all();
 	}
 
+	l_TimerMutex.unlock();
+
 	if (l_TimerThread.joinable())
 		l_TimerThread.join();
+
+	l_TimerMutex.lock();
 }
 
 /**
@@ -140,9 +168,8 @@ void Timer::Start()
 		boost::mutex::scoped_lock lock(l_TimerMutex);
 		m_Started = true;
 
-		if (l_AliveTimers++ == 0) {
-			l_StopTimerThread = false;
-			l_TimerThread = std::thread(&Timer::TimerThreadProc);
+		if (++l_AliveTimers == 1) {
+			InitializeThread();
 		}
 	}
 
@@ -160,15 +187,7 @@ void Timer::Stop(bool wait)
 	boost::mutex::scoped_lock lock(l_TimerMutex);
 
 	if (m_Started && --l_AliveTimers == 0) {
-		l_StopTimerThread = true;
-		l_TimerCV.notify_all();
-
-		lock.unlock();
-
-		if (l_TimerThread.joinable() && l_TimerThread.get_id() != std::this_thread::get_id())
-			l_TimerThread.join();
-
-		lock.lock();
+		UninitializeThread();
 	}
 
 	m_Started = false;
@@ -270,6 +289,8 @@ void Timer::AdjustTimers(double adjustment)
  */
 void Timer::TimerThreadProc()
 {
+	Log(LogDebug, "Timer", "TimerThreadProc started.");
+
 	Utility::SetThreadName("Timer Thread");
 
 	for (;;) {


=====================================
lib/base/timer.hpp
=====================================
--- a/lib/base/timer.hpp
+++ b/lib/base/timer.hpp
@@ -40,7 +40,10 @@ public:
 
 	~Timer() override;
 
+	static void Initialize();
 	static void Uninitialize();
+	static void InitializeThread();
+	static void UninitializeThread();
 
 	void SetInterval(double interval);
 	double GetInterval() const;


=====================================
lib/checker/checkercomponent.cpp
=====================================
--- a/lib/checker/checkercomponent.cpp
+++ b/lib/checker/checkercomponent.cpp
@@ -221,7 +221,7 @@ void CheckerComponent::ExecuteCheckHelper(const Checkable::Ptr& checkable)
 		CheckResult::Ptr cr = new CheckResult();
 		cr->SetState(ServiceUnknown);
 
-		String output = "Exception occured while checking '" + checkable->GetName() + "': " + DiagnosticInformation(ex);
+		String output = "Exception occurred while checking '" + checkable->GetName() + "': " + DiagnosticInformation(ex);
 		cr->SetOutput(output);
 
 		double now = Utility::GetTime();


=====================================
lib/cli/daemoncommand.cpp
=====================================
--- a/lib/cli/daemoncommand.cpp
+++ b/lib/cli/daemoncommand.cpp
@@ -88,6 +88,9 @@ static bool Daemonize()
 		_exit(EXIT_SUCCESS);
 	}
 
+	Log(LogDebug, "Daemonize()")
+		<< "Child process with PID " << Utility::GetPid() << " continues; re-initializing base.";
+
 	Application::InitializeBase();
 #endif /* _WIN32 */
 


=====================================
lib/cli/nodesetupcommand.cpp
=====================================
--- a/lib/cli/nodesetupcommand.cpp
+++ b/lib/cli/nodesetupcommand.cpp
@@ -262,7 +262,7 @@ int NodeSetupCommand::SetupMaster(const boost::program_options::variables_map& v
 			NodeUtility::UpdateConfiguration("\"conf.d/api-users.conf\"", true, false);
 		} else {
 			Log(LogWarning, "cli")
-				<< "Included file dosen't exist " << apiUsersFilePath;
+				<< "Included file doesn't exist " << apiUsersFilePath;
 		}
 	}
 


=====================================
lib/icinga/checkable-check.cpp
=====================================
--- a/lib/icinga/checkable-check.cpp
+++ b/lib/icinga/checkable-check.cpp
@@ -293,7 +293,7 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
 	bool send_notification = false;
 
 	if (notification_reachable && !in_downtime && !IsAcknowledged()) {
-		/* Send notifications whether when a hard state change occured. */
+		/* Send notifications whether when a hard state change occurred. */
 		if (hardChange && !(old_stateType == StateTypeSoft && IsStateOK(new_state)))
 			send_notification = true;
 		/* Or if the checkable is volatile and in a HARD state. */


=====================================
lib/icinga/checkable-notification.cpp
=====================================
--- a/lib/icinga/checkable-notification.cpp
+++ b/lib/icinga/checkable-notification.cpp
@@ -76,7 +76,7 @@ void Checkable::SendNotifications(NotificationType type, const CheckResult::Ptr&
 				notification->BeginExecuteNotification(type, cr, force, false, author, text);
 		} catch (const std::exception& ex) {
 			Log(LogWarning, "Checkable")
-				<< "Exception occured during notification for service '"
+				<< "Exception occurred during notification for service '"
 				<< GetName() << "': " << DiagnosticInformation(ex);
 		}
 	}


=====================================
lib/icinga/clusterevents-check.cpp
=====================================
--- a/lib/icinga/clusterevents-check.cpp
+++ b/lib/icinga/clusterevents-check.cpp
@@ -179,7 +179,7 @@ void ClusterEvents::ExecuteCheckFromQueue(const MessageOrigin::Ptr& origin, cons
 			CheckResult::Ptr cr = new CheckResult();
 			cr->SetState(ServiceUnknown);
 
-			String output = "Exception occured while checking '" + host->GetName() + "': " + DiagnosticInformation(ex);
+			String output = "Exception occurred while checking '" + host->GetName() + "': " + DiagnosticInformation(ex);
 			cr->SetOutput(output);
 
 			double now = Utility::GetTime();


=====================================
lib/icinga/notification.cpp
=====================================
--- a/lib/icinga/notification.cpp
+++ b/lib/icinga/notification.cpp
@@ -524,7 +524,7 @@ void Notification::ExecuteNotificationHelper(NotificationType type, const User::
 			<< "' and user '" << user->GetName() << "'.";
 	} catch (const std::exception& ex) {
 		Log(LogWarning, "Notification")
-			<< "Exception occured during notification for checkable '"
+			<< "Exception occurred during notification for checkable '"
 			<< GetCheckable()->GetName() << "': " << DiagnosticInformation(ex);
 	}
 }


=====================================
lib/notification/notificationcomponent.cpp
=====================================
--- a/lib/notification/notificationcomponent.cpp
+++ b/lib/notification/notificationcomponent.cpp
@@ -130,7 +130,7 @@ void NotificationComponent::NotificationTimerHandler()
 			notification->BeginExecuteNotification(NotificationProblem, checkable->GetLastCheckResult(), false, true);
 		} catch (const std::exception& ex) {
 			Log(LogWarning, "NotificationComponent")
-				<< "Exception occured during notification for object '"
+				<< "Exception occurred during notification for object '"
 				<< GetName() << "': " << DiagnosticInformation(ex);
 		}
 	}


=====================================
third-party/yajl/src/api/yajl_parse.h
=====================================
--- a/third-party/yajl/src/api/yajl_parse.h
+++ b/third-party/yajl/src/api/yajl_parse.h
@@ -35,7 +35,7 @@ extern "C" {
         yajl_status_ok,
         /** a client callback returned zero, stopping the parse */
         yajl_status_client_canceled,
-        /** An error occured during the parse.  Call yajl_get_error for
+        /** An error occurred during the parse.  Call yajl_get_error for
          *  more information about the encountered error */
         yajl_status_error
     } yajl_status;
@@ -192,7 +192,7 @@ extern "C" {
      *  parse.
      *
      *  If verbose is non-zero, the message will include the JSON
-     *  text where the error occured, along with an arrow pointing to
+     *  text where the error occurred, along with an arrow pointing to
      *  the specific char.
      *
      *  \returns A dynamically allocated string will be returned which should
@@ -211,7 +211,7 @@ extern "C" {
      *
      * In the event an error is encountered during parsing, this function
      * affords the client a way to get the offset into the most recent
-     * chunk where the error occured.  0 will be returned if no error
+     * chunk where the error occurred.  0 will be returned if no error
      * was encountered.
      */
     YAJL_API size_t yajl_get_bytes_consumed(yajl_handle hand);


=====================================
tools/selinux/icinga2.te
=====================================
--- a/tools/selinux/icinga2.te
+++ b/tools/selinux/icinga2.te
@@ -1,4 +1,4 @@
-policy_module(icinga2, 0.1.6)
+policy_module(icinga2, 0.1.7)
 
 ########################################
 #
@@ -122,6 +122,7 @@ corecmd_exec_bin(icinga2_t)
 
 kernel_read_system_state(icinga2_t)
 kernel_read_network_state(icinga2_t)
+kernel_dgram_send(icinga2_t)
 
 # should be moved to nagios_plugin_template in nagios.if
 icinga2_execstrans(nagios_admin_plugin_exec_t, nagios_admin_plugin_t)



View it on GitLab: https://salsa.debian.org/nagios-team/pkg-icinga2/commit/14004f1008cb311e70ca06e4d5a20171a8fa7a8a

-- 
View it on GitLab: https://salsa.debian.org/nagios-team/pkg-icinga2/commit/14004f1008cb311e70ca06e4d5a20171a8fa7a8a
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-nagios-changes/attachments/20180725/73d66986/attachment-0001.html>


More information about the pkg-nagios-changes mailing list