mirror of
http://git.haproxy.org/git/haproxy.git
synced 2026-02-14 09:39:19 +02:00
BUG/MEDIUM: startup: fix zero-warning mode
Let's check the second time a global counter of "ha_warning" messages, if zero-warning is set. And let's do this just before forking. At this moment we are sure, that we've already done all init operations, where we could emit "ha_warning", and we still have stderr fd opened. Even with the second check, we could lost some late and rare warnings about failing to drop supplementary groups and about re-enabling core dumps. Notes about this are added into 'zero-warning' keyword description.
This commit is contained in:
committed by
Willy Tarreau
parent
beaa0e1635
commit
fcd4bf54c8
@@ -3485,6 +3485,14 @@ int main(int argc, char **argv)
|
||||
clock_adjust_now_offset();
|
||||
ready_date = date;
|
||||
|
||||
/* catch last warnings, which could be produced while adjusting limits
|
||||
* or preallocating fds
|
||||
*/
|
||||
if (warned & WARN_ANY && global.mode & MODE_ZERO_WARNING) {
|
||||
ha_alert("Some warnings were found and 'zero-warning' is set. Aborting.\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (global.mode & (MODE_DAEMON | MODE_MWORKER | MODE_MWORKER_WAIT)) {
|
||||
int ret = 0;
|
||||
int in_parent = 0;
|
||||
|
||||
Reference in New Issue
Block a user