136 Commits

Author SHA1 Message Date
Richard Mortimer
63926c6e0d
Process: Clean up process table entry even when kill(2) fails with ESRCH (#10375)
* Icinga daemon leaves zombie processes on very busy system

On a very heavily loaded system the process group kill can
be delayed until after the regular TERM signal has caused
the process to exit. In this situation the waitpid call
is valid and reaps the zombie process that would otherwise
be left behind.

* Update AUTHORS file
2025-03-18 11:29:00 +01:00
Alexander A. Klimov
d48b369554 Reset all signal handlers of child processes
... not to disturb check plugins.

refs #6912
2024-01-17 12:25:59 +01:00
Alexander Aleksandrovič Klimov
55930c8042
ProcessSpawnImpl(): remove redundant _exit(128);
Now this if doesn’t _exit(128) by itself, but "return" to the outer if which immediately _exit(128)s.
2023-03-02 12:45:15 +01:00
Julian Brost
a55939e462 Override exit code on process timeout
As Icinga first sends a SIGTERM to a check plugin on timeout to allow it to
terminate gracefully, this is not really part of the plugin API specification
and we cannot assume that plugins will handle this correctly and still exit
with an exit code that maps to UNKNOWN. Therefore, once Icinga decides to kill
a process, force its exit code to 128 to be sure the state will be UNKNOWN
after a timeout.
2021-07-27 17:57:19 +02:00
Alexander A. Klimov
0fd474ee8d Hide $NOTIFY_SOCKET from plugins
refs #7329
2021-06-23 17:42:25 +02:00
Alexander Aleksandrovič Klimov
ef8619f76b
Merge pull request #8601 from Icinga/feature/replace-std-boost-bind-with-lambdas-7006
Feature: Replace std/boost::bind() with lambdas
2021-03-18 17:56:13 +01:00
Yonas Habteab
43ba2da39c Replace std/boost::bind() function with lambda expression 2021-03-10 16:29:40 +01:00
Alexander Aleksandrovič Klimov
aa0baf6f69
Merge pull request #8099 from Icinga/feature/std-mutex
Use std::mutex, not boost::mutex
2021-02-04 10:19:04 +01:00
Alexander A. Klimov
c3388e9af6 Use std::mutex, not boost::mutex 2021-02-03 09:54:57 +01:00
Alexander Aleksandrovič Klimov
91ffa89dad
Merge pull request #7918 from Icinga/feature/check-timeouts-sigterm-6162
On check_timeout first send SIGTERM
2021-01-21 16:11:07 +01:00
Alexander A. Klimov
e1bc4d474f On check_timeout first send SIGTERM
... to allow check plugins to terminate gracefully.

refs #6162
2021-01-14 12:00:11 +01:00
Alexander A. Klimov
26c944125b Close FDs based on /proc/self/fd
... not to waste time with close(2)ing RLIMIT_NOFILE-3 non-existing FDs.

Newer kernel = higher RLIMIT_NOFILE = more time wasted

refs #8437
2021-01-12 17:32:28 +01:00
Julian Brost
4c8c4c75ec Add Process::WaitForResult to allow waiting for the process to finish 2020-11-16 17:10:26 +01:00
Yonas Habteab
24c6210ef2 Fix don't set LC_NUMERIC twice 2020-07-06 13:12:56 +02:00
Michael Insel
d7dfa6f1df Terminate windows check processes with UNKNOWN state on timeout
On Windows this terminates checks that reached the timeout with the UNKNOWN
state instead the WARNING state.

Co-authored-by: araujorm <araujorm@users.noreply.github.com>
2020-01-27 21:43:01 +01:00
Michael Friedrich
c2f180395a
Merge pull request #7000 from Icinga/bugfix/goto-loop
Don't abuse goto for building simple loops
2019-04-03 09:46:17 +02:00
Michael Friedrich
804c00ece5
Merge pull request #6999 from Icinga/bugfix/compiler-warnings
Suppress or fix compiler warnings
2019-03-18 08:44:30 +01:00
Alexander A. Klimov
ac354f9e80 Don't abuse goto for building simple loops 2019-03-08 14:59:01 +01:00
Alexander A. Klimov
bf92e32496 Suppress or fix compiler warnings 2019-03-08 14:07:29 +01:00
Michael Friedrich
d14a88235d Replace Copyright header with a short version, part I
CLion -> replace in path
2019-02-25 14:48:22 +01:00
Michael Friedrich
dab53448bc icinga.com: Update *.{h,c}pp 2018-10-18 09:27:04 +02:00
Michael Friedrich
b81ac972b9 Silence compiler warning for nice() 2018-09-14 14:29:52 +02:00
Gunnar Beutner
c2fb9fe226 Use initializer lists for arrays and dictionaries 2018-01-16 12:27:44 +01:00
Gunnar Beutner
71ee5ac698 Build fix 2018-01-04 12:33:51 +01:00
Gunnar Beutner
e3ad0be769 Apply clang-tidy fix 'modernize-use-auto' 2018-01-04 12:24:57 +01:00
Gunnar Beutner
621eed3f13 Apply clang-tidy fix 'modernize-pass-by-value' 2018-01-04 12:24:57 +01:00
Gunnar Beutner
6da7d48d25 Apply clang-tidy fix 'modernize-loop-convert' 2018-01-04 12:24:57 +01:00
Gunnar Beutner
ac155d1dda Apply clang-tidy fix 'modernize-redundant-void-arg' 2018-01-04 12:24:57 +01:00
Michael Insel
158ae2188e Change copyright header for 2018 2018-01-02 12:08:55 +01:00
Jean Flach
2636e6a77a Whitespace fix
What does this change?
* Remove use of spaces for formatting
These could be found by using `grep -r -l -P '^\t+ +[^*]'
* Removal of training whitespaces
* A few lines longer than 120 chars
2017-12-20 14:53:52 +01:00
Gunnar Beutner
1ad83886ac Replace a few more NULLs with nullptr 2017-12-14 15:37:20 +01:00
Gunnar Beutner
2e87c280ed Use initializer lists instead of std::vector::push_back 2017-11-30 17:47:09 +01:00
Gunnar Beutner
7d7eaa8dd3 Replace boost::thread with std::thread 2017-11-30 17:39:20 +01:00
Gunnar Beutner
858873b940 Replace boost::bind/boost::function with std::bind/std::function 2017-11-27 15:15:11 +01:00
Noah Hilverling
3e8f78e2cc Process: Fix fork error handling
refs #5617
2017-10-23 11:01:42 +02:00
Noah Hilverling
7930ae5094 Process: Remove log message from child process 2017-10-23 11:01:16 +02:00
Michael Friedrich
0b1ce7111c Merge pull request #5231 from Al2Klimov/bugfix/failure-to-kill-check-command-after-exceeding-timeout-is-not-reported-4981
Report failure to kill check command after exceeding timeout
2017-10-13 13:57:26 +02:00
Noah Hilverling
5b9337e130 Process: Fix JSON parsing error on process helper crash 2017-08-14 08:27:04 +02:00
Michael Friedrich
6036ec20f5 Build fix for Debian Wheezy
fixes #5350
2017-06-16 16:57:05 +02:00
Alexander A. Klimov
8bf3ab0285 Produce an unknown check result if we failed to kill the process
refs #4981
2017-05-12 15:25:22 +02:00
Alexander A. Klimov
c45529b407 Report failure to kill check command after exceeding timeout
refs #4981
2017-05-05 17:31:14 +02:00
Gunnar Beutner
06c2a4088d Ensure that only child processes for checks are reniced
fixes #4989
2017-02-21 11:31:07 +01:00
Gunnar Beutner
060e20f5a3 Clean up the patch for the crash issue in the Process class
fixes #13655
2017-01-16 14:15:42 +01:00
Lucas Fairchild-Madar
9fa3f3b122 Fix crash when sending/receiving messages longer than 4 kB to/from the child process for the Process class
refs #13655

Signed-off-by: Michael Friedrich <michael.friedrich@icinga.com>
2017-01-16 14:15:39 +01:00
Gunnar Beutner
751ca67e0a Ignore SIGPIPE earlier in the start-up process
fixes #13567
2017-01-12 10:50:43 +01:00
Michael Friedrich
b7caf0820d Ensure that *.icinga.com is used everywhere
fixes #13897
fixes #13277
2017-01-10 17:19:12 +01:00
Michael Friedrich
fb8f4105ad Block SIGPIPE signal for check processes
refs #13567
2016-12-15 11:47:07 +01:00
Gunnar Beutner
78fa197b9f Properly unmask signals for child processes
fixes #13269
2016-11-22 13:53:58 +01:00
Gunnar Beutner
c0bc156696 Don't mask all signals in the subprocess handler
fixes #12940
2016-10-24 08:42:40 +02:00
Jean Flach
069de6c121 Don't use InitializeSpawnHelper on Windows
refs #8900
2016-10-05 15:10:43 +02:00