-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
launch command worker earlier #470
base: master
Are you sure you want to change the base?
Conversation
since the command worker forks the main naemon process, it inherits all open files like ex.: pidfile, logfiles, etc... It will keep those references open, even if the main process rotates and reopens those files. This patch closes query handler and pid file references after starting the command worker and also moves starting the command worker before initializing the neb modules, so it won't inherit open logfiles from neb modules. references: - ConSol-Monitoring/omd#146 Signed-off-by: Sven Nierlein <[email protected]>
ddc4d76
to
e842ca7
Compare
The only issue I see with this is that the command file worker completely loses the ability to communicate. Currently, the command file worker is able to write to the naemon-core/src/naemon/commands.c Line 392 in 22f0fb6
After that, it can only write to Due to the change, the command file worker can't even write to This change also introduces a sort of "breaking change". Currently, whenever Naemon logs the message I personal only use this when working or debugging Naemon directly, but it turns out that some scripts rely on this. For example, this one which is part of our repository: naemon-core/features/steps/naemon.py Lines 138 to 155 in 22f0fb6
I think we should add a new message to the log that clearly indicates that Naemon is ready. Something like
|
i am not to happy yet either, maybe we keep the order as it was but send a USR1 signal to the command worker so it can rotate/reopen the logfile as well. |
btw, the message |
Currently the command file worker can only write to I think this is also the reason why the
Yes, this message gets still logged as before, but due due it is now before the broker modules get loaded, it does not indicate that Naemon is ready anymore. |
since the command worker forks from the main naemon process, it inherits all open files like ex.: pidfile, logfiles, etc... It will keep those references open, even if the main process rotates and reopens those files.
This patch closes query handler and pid file references after starting the command worker and also moves starting the command worker before initializing the neb modules, so it won't inherit open logfiles from neb modules.
references: