Commit Graph

287 Commits

Author SHA1 Message Date
Alexander Aleksandrovič Klimov 6048d0e800
Merge pull request #8373 from Icinga/feature/improve-crashlog
Improve crashlog
2021-06-29 17:52:25 +02:00
Yonas Habteab 43ba2da39c Replace std/boost::bind() function with lambda expression 2021-03-10 16:29:40 +01:00
Julian Brost b931194f59 Use backtrace_symbols() when printing stack traces on FreeBSD
Unfortunately, the symbol resolution of boost::stacktrace is broken on
FreeBSD, therefore fall back to using backtrace_symbols() to print the
stack trace saved by Boost.

Additionally, -D_GNU_SOURCE is required on FreeBSD for the
_Unwind_Backtrace function used by boost::stacktrace.
2021-03-01 14:07:09 +01:00
Julian Brost 7d3885d05c Crash handlers: use more compact string representation 2021-03-01 14:06:47 +01:00
Julian Brost 710cd7287f Begin crash log for SIGABRT with error message and timestamp
This makes the format more similar to what the uncaught C++ and SEH
exception handlers write. Previously there was no indication in the
crash log that a SIGABRT happened.
2021-03-01 14:06:47 +01:00
Julian Brost 15a16b23d9 Pass fallback stacktrace to DiagnosticInformation in terminate handler
By default, DiagnosticInformation uses the stack trace saved when the
exception was thrown, but this mechanism is not in use on Windows.
Gathering a stacktrace in the terminate handler serves as a fallback.
2021-03-01 14:06:47 +01:00
Julian Brost 5cb7c7cc09 Replace icinga::StackTrace with boost::stacktrace::stacktrace
Provides roughly the same functionality but works better on certain
platforms (especially Windows) and is less code to maintain.
2021-03-01 14:06:44 +01:00
Julian Brost e11b4b7b55 Print details in uncaught SEH exception handler 2021-03-01 14:05:27 +01:00
Julian Brost 68e4b807d1 Move error message and time to the beginning of the SEH crash log
This is more similar to the normal exception crashlog which also states
the problem and time at the beginning of the file.
2021-03-01 14:05:27 +01:00
Julian Brost 0db59bad83 Use boost::stacktrace instead of custom implementation in Windows SEH filter 2021-03-01 14:05:27 +01:00
Julian Brost f8b7a1511b Run termination handler for uncaught C++ exceptions on Windows
On Windows, the termination handler is executed for uncaught C++
exceptions unless a SEH unhandled exception filter is also set. In this
case, this filter has to explicitly chain the default filter to keep
this behavior.
2021-03-01 14:05:27 +01:00
Alexander A. Klimov d69c6879fa Application#RunEventLoop(): don't wait for the thread pool to stop on shutdown
refs #8173
2020-09-03 14:04:42 +02:00
Noah Hilverling 4c9e4959f3
Merge pull request #7823 from Icinga/bugfix/unify-application-start-times
Fix timing point for Application::GetStartTime() (related to command endpoint grace period)
2020-03-09 09:45:57 +01:00
Michael Friedrich 71c7eebe4e CLI: Add OpenSSL version to 'Build' section in --version
This helps to see against which OpenSSL version Icinga was built.
Inspired by #5572
2020-02-14 08:55:39 +01:00
Michael Friedrich d53eb34520 Unify Application::GetStartTime() and drop GetMainTime()
This essentially moves the start time into the scope when main
starts to "do something", after the reload and configuration handling
is done.
2020-02-11 17:26:15 +01:00
Michael Friedrich ae8a0b6a64 Introduce Application::GetUptime() 2020-02-11 16:47:50 +01:00
Alexander A. Klimov 31e5394fe9 Fix style
refs #5230
2019-07-16 11:45:23 +02:00
Alexander A. Klimov 4ee9ac16b4 Fix missing comments
refs #5230
2019-07-16 11:11:10 +02:00
Alexander A. Klimov 3584ad97d8 Fix missing log messages
refs #5230
2019-07-15 18:29:15 +02:00
Alexander A. Klimov ac29b3b93a Adjust sd_notify()
refs #5230
2019-07-15 17:04:55 +02:00
Alexander A. Klimov 06b504f291 Adjust PID file management
refs #5230
2019-07-15 17:04:53 +02:00
Alexander A. Klimov 37a3e7e4d5 Application::RunEventLoop(): forward restart requests to umbrella process
refs #5230
2019-07-15 15:23:37 +02:00
Alexander A. Klimov d6bc5a1a18 Remove old signal handlers
refs #5230
2019-07-15 15:06:29 +02:00
Michael Friedrich 78e24c53f1 DB IDO: Do not deactivate objects during application reload/restart
This follows the same principle as with the shutdown handler,
and was introduced with the changed reload handling with 2.9.
Previously IsShuttingDown() was sufficient which got set at one
location.

SigUsr2 as handler introduced a new location where m_ShuttingDown
is not necessarily set yet. Since this handler gets called when
l_Restarting is enabled, we'll use this flag to avoid config update
events resulting in object deactivation (object->IsActive() always
returns false).

refs #5996
refs #6691
refs #6970

fixes #7125
2019-05-03 15:40:48 +02:00
Michael Friedrich df25b183cb Add log message for log rotate; update docs
refs #6737
2019-04-24 11:53:27 +02:00
Michael Friedrich b906714254 Fix that MaxConcurrentChecks constant is overridden from 'checker' feature
Note: This drops the deprecated concurrent_checks setting from the checker feature
entirely and refactors the underlaying code handling.

Also affects ReloadTimeout which is new for 2.11.

fixes #7111
2019-04-16 15:04:57 +02: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 e2df11520e
Merge pull request #6970 from Icinga/bugfix/perfdata-gaps
Improve reload handling for features (metric & queue flush, activation priority)
2019-02-26 15:38:15 +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 ab7a799369 Implement ReloadTimeout constant and wait for enqueued checks on Stop() 2019-02-25 09:03:47 +01:00
Michael Friedrich f3cd3eb870 DSL: Implement getenv()
This patch also restores Utility::GetFromEnvironment()
and replaces the hardcoded `getenv()` calls.
2018-11-19 18:11:16 +01:00
Michael Friedrich dab53448bc icinga.com: Update *.{h,c}pp 2018-10-18 09:27:04 +02:00
Michael Friedrich af6c8a1f50 Add missing shutdown/program state dumps for SIGUSR2 reload handler
Credits to @west0rmann finding the issue and providing the initial fix.

fixes #6689
fixes #6592
2018-10-16 12:36:43 +02:00
Michael Friedrich 96c0de9bea Allow to override MaxConcurrentChecks constant 2018-09-27 20:23:00 +02:00
Gunnar Beutner e678fa1aa5 Refactor Application::*Const() 2018-08-13 15:27:05 +02:00
Michael Friedrich 9be3ee1a1a Update output for `--version`
This moves the system and build information before
the application paths which are normally not that important.
2018-08-07 18:46:18 +02:00
Markus Frosch 9fbc40615a Improve path handling in cmake and daemon 2018-08-07 14:10:26 +02:00
Michael Friedrich 7519d23892 Add debug logging for daemonize/timers
The previous commit is 1:1 the same I've implemented
here already. Great teamwork with Alex :)

refs #6445
2018-07-19 13:34:12 +02:00
Alexander A. Klimov d15e1006f3 Re-introduce Timer::Initialize()
refs #6445
2018-07-19 13:22:37 +02:00
Michael Friedrich 9b99c9d106 Remove leftover for sysconfig file parsing
refs #6255
2018-06-18 19:25:48 +02:00
Jean Flach 9a5d464448 Revert "Fix Windows reload"
This reverts commit 691e3cfd57.
2018-06-12 12:19:16 +02:00
Jean Flach 0b1d5013ac Revert "fixup set rlimit stack failed condition"
This reverts commit bf959371c4.

fixes #6257
2018-04-25 14:26:40 +02:00
Jean Flach 2c8dfcc1aa Fix typo 2018-04-23 10:18:31 +02:00
Jean Flach 8b0126411b Add improved error messages for resource limits
refs #6215
2018-04-19 08:55:05 +02:00
Michael Friedrich da9b3991aa
Merge pull request #6163 from Icinga/fix/handle-restart
Fix reload handling by updating the PID file before process overtake
2018-04-03 17:18:29 +02:00
Jean Flach 92f7242db1
Merge pull request #6119 from tclh123/dev
fixup set rlimit stack failed condition
2018-03-21 09:56:47 +01:00
Jean Flach a742e64e4d Fix reload handling
Make sure we have written the new PID before letting it take over.
2018-03-14 10:43:59 +01:00