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
[dev.icinga.com #5788] Improve daemon startup logic/order #1313
Comments
Updated by gvegidy on 2014-03-23 19:53:20 +00:00 on it now, see https://github.com/gvegidy/icinga2/tree/feature/daemon-startup-5788 for my progress |
Updated by gvegidy on 2014-04-06 22:54:25 +00:00 after working on this & some irc discussion:
reload handling:
|
Updated by gvegidy on 2014-04-15 21:43:36 +00:00 implemented and tested the logic as described: it works flawlessly with a classic sysv-init or upstart. But newer systemd versions (I tried 208 from Fedora 20) seem to observe the processes started from a reload task trough cgroups. When the reload command is done, the new daemon forked from the reload is killed by systemd. I've observed that through strace, the systemd debug log says nothing about that. Will take a look at the systemd code next, maybe I don't understand this fully yet or there is a workaround available. |
Updated by gbeutner on 2014-04-29 11:19:47 +00:00
Applied in changeset 50b878c. |
Updated by mfriedrich on 2014-04-29 15:10:11 +00:00
Running it in foreground on terminal and sending SIGHUP is a bit weird but to be honest - you won't do that when debugging icinga 2 anyways. The rest works like a charm - thanks for the hard work & joining the team! |
This issue has been migrated from Redmine: https://dev.icinga.com/issues/5788
Created by gvegidy on 2014-03-17 23:15:13 +00:00
Assignee: gvegidy
Status: Resolved (closed on 2014-04-29 11:19:47 +00:00)
Target Version: 0.0.10
Last Update: 2014-04-29 15:10:10 +00:00 (in Redmine)
Currently the configuration is verified in the init script before the actual icinga daemon is started. Due to subtle differences between these calls (e.g. we had the permission problem before #5761 was fixed, similar bugs might still be there, or the files might change in between the calls), the config could verify ok, but the daemon not start correctly.
When reloading is initiated through the init script, it verifies the config again and only sends the SIGHUP when it is ok. This does not handle cases where SIGHUP is not sent by the init script.
In all cases where we have errors during config load, we currently have problems sending the error message to the user because
See Bugs #5787, #5773, #5666
When we have daemonized, the initscript has no chance of finding out if icinga was really started or not.
To solve all this, I propose the following order during daemon start:
When the daemon receives SIGHUP it checks the current config.
when not ok: log the error, stay alive with the current config
when ok: log restart, shutdown, fork new process as it is currently done
Does this make sense?
Changesets
2014-04-13 19:17:42 +00:00 by gvegidy 4a5181f
2014-04-13 22:16:48 +00:00 by gvegidy b7ba9e5
2014-04-27 19:47:25 +00:00 by gvegidy 9eb06ed
2014-04-27 21:40:37 +00:00 by gvegidy b24c2b9
2014-04-28 11:17:05 +00:00 by gvegidy a0cd174
2014-04-28 11:17:05 +00:00 by gvegidy 2c6abdb
2014-04-28 11:17:05 +00:00 by gvegidy 21bc529
2014-04-28 11:17:05 +00:00 by gvegidy f7dd5fe
2014-04-28 12:59:20 +00:00 by gbeutner 509a904
2014-04-28 19:34:35 +00:00 by gvegidy d5fec60
2014-04-28 19:34:35 +00:00 by gvegidy 36f5377
2014-04-28 19:36:54 +00:00 by gvegidy 244d761
2014-04-28 19:36:58 +00:00 by gvegidy e400e03
2014-04-28 21:30:56 +00:00 by gvegidy 8aa7e7e
2014-04-28 22:05:39 +00:00 by gvegidy ebdd28d
2014-04-29 08:34:01 +00:00 by gvegidy 19afcd8
2014-04-29 08:34:01 +00:00 by gvegidy 33bd909
2014-04-29 08:34:01 +00:00 by gvegidy 3a294bb
2014-04-29 08:34:02 +00:00 by gvegidy 3ece2ba
2014-04-29 08:34:02 +00:00 by gvegidy 9f56b6e
2014-04-29 08:34:02 +00:00 by gvegidy 1e321f0
2014-04-29 08:34:08 +00:00 by gbeutner 50b878c
2014-05-01 09:27:43 +00:00 by (unknown) e9fddcc
2014-05-01 18:09:38 +00:00 by (unknown) 630a1a2
The text was updated successfully, but these errors were encountered: