439 Commits

Author SHA1 Message Date
Alexander Aleksandrovič Klimov
866db3ba3c
Merge pull request #10137 from Icinga/win-progfiles-icinga2-var
On Windows, don't create C:\Program Files\Icinga2\var during MSI build
2025-01-16 12:02:33 +01:00
Alexander A. Klimov
6195a457a7 Silence compiler warnings in code we don't maintain 2025-01-14 11:48:33 +01:00
Alexander A. Klimov
f96e7c67ee On Windows, don't create C:\Program Files\Icinga2\var during MSI build 2024-08-23 12:49:09 +02:00
Julian Brost
2470e930eb
Merge pull request #9643 from Icinga/hardware_concurrency
Always use Configuration#Concurrency, not `std:🧵:hardware_concurrency()`
2023-05-23 19:23:14 +02:00
Alexander A. Klimov
3fae41ef22 Restart thread pool after freezing Configuration
The user (-D) or we could have changed Configuration.Concurrency,
so correct the thread pool's thread amount.
2023-05-23 14:41:35 +02:00
Alexander A. Klimov
32eb1680f7 Configuration.Concurrency: default to 1 until Configuration freeze
not to start many threads before the user could override their amount (-D).
2023-05-11 16:59:47 +02:00
Julian Brost
d2fb8a9181 Handle errors when evaluating --define
This can be observed when running something like `icinga2 daemon -C -DTypes.Host=42`.

Without this commit:

    [2023-02-01 09:29:00 +0100] critical/Application: Error: Namespace is read-only and must not be modified.

    Additional information is available in '/var/log/icinga2/crash/report.1675240140.425155'

With this commit:

    [2023-02-01 09:30:37 +0100] critical/icinga-app: cannot set 'Types.Host': Namespace is read-only and must not be modified.
2023-02-01 09:30:49 +01:00
Julian Brost
0503ca1379 Initialize namespaces without using overrideFrozen
This commit adds a new initialization priority `FreezeNamespaces` that is run
last and moves all calls to `Namespace::Freeze()` there. This allows all other
initialization functions to still update namespaces without the use of the
`overrideFrozen` flag.

It also moves the initialization of `System.Platform*` and `System.Build*` to
an initialize function so that these can also be set without setting
`overrideFrozen`.

This is preparation for a following commit that will make the frozen flag in
namespaces finial, no longer allowing it to be overriden (freezing the
namespace will disable locking, so performing further updates would be unsafe).
2023-01-19 09:53:36 +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
5224648ee0
Merge pull request #8451 from Icinga/bugfix/http
s/http/https/g
2020-12-02 10:40:58 +01:00
Alexander A. Klimov
af0f5544f7 s/http/https/g 2020-12-01 18:41:58 +01:00
Alexander Aleksandrovič Klimov
2d5e244127
Merge pull request #8232 from Icinga/bugfix/windows-version
Fix Windows .exe version v2.12.0 -> 2.12.0
2020-11-13 17:09:58 +01:00
Alexander A. Klimov
25f926e201 Fix Windows .exe version v2.12.0 -> 2.12.0 2020-09-11 15:56:51 +02: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
Alexander A. Klimov
1a99b3eeb3 Main(): don't call Process::InitializeSpawnHelper() 2019-11-04 17:30:28 +01:00
Alexander Aleksandrovič Klimov
04dfbb07ce Rename ICINGA2_WITH_REDIS to ICINGA2_WITH_ICINGADB 2019-11-02 14:00:24 +01:00
Alexander Aleksandrovič Klimov
13ab7eb609 Rename redis to icingadb 2019-11-02 14:00:24 +01:00
Michael Friedrich
ddf2aea065 Compile redis into the icinga2 binary; apply more C++11 code changes 2019-11-02 14:00:23 +01:00
Michael Friedrich
36b7ad68a4 Windows binary: Also update the exe icon
A thousand places for everything.
2019-08-27 15:12:22 +02:00
Michael Friedrich
aed88ca477 Revert "CLI: Return non-zero on unknown sub commands"
This reverts commit 00bc0b230357bf02c1c9da4ca59c2d359c73a538.
2019-05-10 15:16:05 +02:00
Michael Friedrich
00bc0b2303 CLI: Return non-zero on unknown sub commands
fixes #6585
2019-05-07 12:43:53 +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
Markus Frosch
ff3a2fe3da CMake: Handle INSTALL_RPATH globally and allow external additions 2019-04-01 13:31:16 +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
bf92e32496 Suppress or fix compiler warnings 2019-03-08 14:07:29 +01:00
Michael Friedrich
37b715baf1 Replace a few more copyright strings 2019-02-25 16:30:40 +01:00
Michael Friedrich
458f997a18 Replace Copyright header with a short version, part II 2019-02-25 15:09:36 +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
c1fedab7ae Dynamically print current copyright year in --version output 2019-02-25 14:25:56 +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
0072a6f7d9 icinga.com: Update icinga-app 2018-10-18 09:39:34 +02:00
Michael Friedrich
dea5ec614e icinga.com: Update CMakeLists.txt 2018-10-18 09:35:18 +02:00
Michael Friedrich
dab53448bc icinga.com: Update *.{h,c}pp 2018-10-18 09:27:04 +02:00
Michael Friedrich
7abfe13a00 Remove default environment, regression from e678fa1aa5
refs #6512
fixes #6694
2018-10-17 12:45:13 +02:00
Michael Friedrich
db322ebce1
Merge pull request #6679 from Icinga/bugfix/initialize-initrundir-constant-on-windows
Initialize Configuration::InitRunDir for Windows and writing the PID file
2018-10-15 09:38:35 +02:00
Michael Friedrich
1c7fddb780 Initialize Configuration::InitRunDir for Windows and writing the PID file
Even if this some Unix specific stuff, we rely on writing this file
in our generic application code. Therefore its path needs to be specified.

This got broken with 9fbc406 which renamed RunDir to InitRunDir, but
didn't re-add it to the Windows #ifdefs.

fixes #6677
2018-10-15 09:24:46 +02:00
Bas Couwenberg
f0aaecb90c Fix spelling errors.
compatiblity -> compatibility
2018-10-15 08:56:18 +02:00
Gunnar Beutner
e678fa1aa5 Refactor Application::*Const() 2018-08-13 15:27:05 +02:00
Gunnar Beutner
10d6f70a85 Move constants and functions into different namespaces 2018-08-13 13:44:31 +02:00
Gunnar Beutner
1a8692d972 Implement support for namespaces 2018-08-13 13:44:31 +02:00
Markus Frosch
eb02d9041d Refactor environment for API connections
* Const renamed to `ApiEnvironment`
* Handling moved to ApiListener
* Now a property of ApiListener
2018-08-09 13:19:33 +02:00
Michael Friedrich
a2a1f5c8d2 Take a note why the explicit configDir variable is needed on Windows 2018-08-07 18:33:59 +02:00
Michael Friedrich
81faf9b7c3 Refine log messages and code comments 2018-08-07 17:58:22 +02:00
Markus Frosch
9fbc40615a Improve path handling in cmake and daemon 2018-08-07 14:10:26 +02:00
Markus Frosch
ddc5b951b3
Revert "Implement support for the --env command-line argument" 2018-07-26 17:09:06 +02:00
Gunnar Beutner
c577554073 Implement support for the --env command-line argument 2018-06-27 13:15:52 +02:00
Michael Friedrich
9b99c9d106 Remove leftover for sysconfig file parsing
refs #6255
2018-06-18 19:25:48 +02:00
Jean Flach
4b17e739eb Don't log when running autocomplete
Logging breaks autocomplete, with this patch we should only log when
something is going terribly wrong and execution can't be guaranteed or
is destined to fail.
This commit depends on the previous one which is why it's not in its own
pull request.

fixes #6256
2018-05-23 15:18:53 +02:00
Jean Flach
ed4e008e79 Rework sysconfig file
The sysconfig file now only contains the defaults as comments, changes
made there are given to the init.d script, prepare-dirs, safe-reload and
Icinga 2 itself. If nothing is set in the sysconfig file (as is the
default as all lines are commented out) the defaults are used.

fixes #6255
2018-05-23 15:18:42 +02:00
Gunnar Beutner
9c1e00eb94 Introduce the 'Environment' variable 2018-05-15 12:02:15 +02:00