From 4215d7d0336b40e934bb30f4524d4bbe58a8a5f6 Mon Sep 17 00:00:00 2001 From: Baptiste Assmann Date: Wed, 2 Nov 2016 15:33:15 +0100 Subject: [PATCH] MINOR: init: move apply_server_state in haproxy.c before MODE_CHECK Currently, the function which applies server states provided by the "old" process is applied after configuration sanity check. This results in the impossibility to check the validity of the state file during a regular config check, implying a full start is required, which can be a problem sometimes. This patch moves the loading of server_state file before MODE_CHECK. --- src/haproxy.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/haproxy.c b/src/haproxy.c index 80d503086..896d11693 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -952,6 +952,12 @@ void init(int argc, char **argv) } #endif + /* Apply server states */ + apply_server_state(); + + for (px = proxy; px; px = px->next) + srv_compute_all_admin_states(px); + if (global.mode & MODE_CHECK) { struct peers *pr; struct proxy *px; @@ -973,12 +979,6 @@ void init(int argc, char **argv) exit(2); } - /* Apply server states */ - apply_server_state(); - - for (px = proxy; px; px = px->next) - srv_compute_all_admin_states(px); - global_listener_queue_task = task_new(); if (!global_listener_queue_task) { Alert("Out of memory when initializing global task\n");