Skip to content
Commits on Source (5)
......@@ -11,6 +11,7 @@ Andrew Meyer <ameyer+secure@nodnetwork.org>
Andy Grunwald <andygrunwald@gmail.com>
Arnd Hannemann <arnd@arndnet.de>
Assaf Flatto <assaf@aikilinux.com>
Bas Couwenberg <sebastic@xs4all.nl>
Bastian Guse <bguse@nocopy.de>
Benedikt Heine <bebe@bebehei.de>
Bernd Erk <bernd.erk@icinga.com>
......
# 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: 2.9.0
Version: 2.9.1
Revision: 1
icinga2 (2.9.1-1) unstable; urgency=medium
* Team upload.
* New upstream release.
* Drop spelling-errors.patch, applied upstream.
-- Bas Couwenberg <sebastic@debian.org> Wed, 25 Jul 2018 06:22:55 +0200
icinga2 (2.9.0-1) unstable; urgency=medium
* Team upload.
......
21_config_changes
42_mips_boost_bind_workaround
spelling-errors.patch
postgres-checkcommand.patch
Description: Fix spelling errors.
* occured -> occurred
* dosen't -> doesn't
Author: Bas Couwenberg <sebastic@debian.org>
Forwarded: https://github.com/Icinga/icinga2/pull/6470
--- 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.
*/
--- a/lib/checker/checkercomponent.cpp
+++ b/lib/checker/checkercomponent.cpp
@@ -221,7 +221,7 @@ void CheckerComponent::ExecuteCheckHelpe
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();
--- a/lib/icinga/checkable-check.cpp
+++ b/lib/icinga/checkable-check.cpp
@@ -293,7 +293,7 @@ void Checkable::ProcessCheckResult(const
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. */
--- a/lib/icinga/checkable-notification.cpp
+++ b/lib/icinga/checkable-notification.cpp
@@ -76,7 +76,7 @@ void Checkable::SendNotifications(Notifi
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);
}
}
--- a/lib/icinga/notification.cpp
+++ b/lib/icinga/notification.cpp
@@ -524,7 +524,7 @@ void Notification::ExecuteNotificationHe
<< "' 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);
}
}
--- a/lib/notification/notificationcomponent.cpp
+++ b/lib/notification/notificationcomponent.cpp
@@ -130,7 +130,7 @@ void NotificationComponent::Notification
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);
}
}
--- 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);
--- a/lib/icinga/clusterevents-check.cpp
+++ b/lib/icinga/clusterevents-check.cpp
@@ -179,7 +179,7 @@ void ClusterEvents::ExecuteCheckFromQueu
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();
--- a/lib/cli/nodesetupcommand.cpp
+++ b/lib/cli/nodesetupcommand.cpp
@@ -262,7 +262,7 @@ int NodeSetupCommand::SetupMaster(const
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;
}
}
......@@ -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: "
......
......@@ -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
......
......@@ -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
......
......@@ -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 */
......
......@@ -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.
*/
......
......@@ -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::Uninitialize()
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()
{
{
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 (;;) {
......
......@@ -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;
......
......@@ -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();
......
......@@ -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 */
......
......@@ -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;
}
}
......
......@@ -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. */
......
......@@ -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);
}
}
......
......@@ -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();
......
......@@ -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);
}
}
......