bug in event broker callbacks during Nagios startup
Posted: Thu Nov 01, 2018 4:39 pm
I'm looking at Nagios 4.4.2 code.
main() calls daemon_init() [base/nagios.c, line 614] which in turn
calls broker_program_state() [base/utils.c, line 2026] to make a
NEBTYPE_PROCESS_DAEMONIZE callback. But all of that now happens before
neb_init_callback_list() ever gets called [base/nagios.c, line 667],
let alone any event brokers having been loaded via neb_load_all_modules()
[base/nagios.c, line 708]. So at the time of the call to daemon_init(),
no event broker init functions have yet been called so they could register
to receive the NEBTYPE_PROCESS_DAEMONIZE callback.
It's clear in comparison to Nagios 3.5.1 files that this failure is
due to a bunch of code having been shuffled around, without recognizing
this consequence.
main() calls daemon_init() [base/nagios.c, line 614] which in turn
calls broker_program_state() [base/utils.c, line 2026] to make a
NEBTYPE_PROCESS_DAEMONIZE callback. But all of that now happens before
neb_init_callback_list() ever gets called [base/nagios.c, line 667],
let alone any event brokers having been loaded via neb_load_all_modules()
[base/nagios.c, line 708]. So at the time of the call to daemon_init(),
no event broker init functions have yet been called so they could register
to receive the NEBTYPE_PROCESS_DAEMONIZE callback.
It's clear in comparison to Nagios 3.5.1 files that this failure is
due to a bunch of code having been shuffled around, without recognizing
this consequence.