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.
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).
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
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
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
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
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