Module: check_mk
Branch: master
Commit: 21a899e9ebddc980aae5956b337f39019e26a6fa
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=21a899e9ebddc9…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Thu Jun 22 10:46:15 2017 +0200
4694 FIX Reloading the Nagios core works again
Reloading the Nagios core (e.g. via "cmk -O") resulted in a segmentation
fault of Nagios, this has been fixed. This was a regression from the 1.2.8
series.
Change-Id: Ib7faf0368841a6580f40d9ca170a1348b7fcbe41
---
.werks/4694 | 12 ++++++++++++
livestatus/src/module.cc | 3 +++
2 files changed, 15 insertions(+)
diff --git a/.werks/4694 b/.werks/4694
new file mode 100644
index 0000000..1e8630b
--- /dev/null
+++ b/.werks/4694
@@ -0,0 +1,12 @@
+Title: Reloading the Nagios core works again
+Level: 1
+Component: livestatus
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1498121005
+Class: fix
+
+Reloading the Nagios core (e.g. via "cmk -O") resulted in a segmentation
+fault of Nagios, this has been fixed. This was a regression from the 1.2.8
+series.
\ No newline at end of file
diff --git a/livestatus/src/module.cc b/livestatus/src/module.cc
index c01095f..9070545 100644
--- a/livestatus/src/module.cc
+++ b/livestatus/src/module.cc
@@ -337,6 +337,9 @@ void start_threads() {
// start thread that listens on socket
info.name = "main";
pthread_create(&info.id, nullptr, main_thread, &info);
+ // Our current thread (i.e. the main one, confusing terminology)
+ // needs thread-local infos for logging, too.
+ tl_info = &info;
} else {
info.name = "client " + to_string(idx);
pthread_create(&info.id, &attr, client_thread, &info);