From 9d3844510d8b7b40199027286a16b9c3e06352fa Mon Sep 17 00:00:00 2001 From: Arturo Borrero Gonzalez Date: Tue, 6 Jun 2017 12:58:27 +0200 Subject: conntrackd: evaluate configuration earlier Run the evaluation step sooner in the conntrackd startup routine. Don't close log or unlink lockfile at this stage. Signed-off-by: Arturo Borrero Gonzalez Signed-off-by: Pablo Neira Ayuso --- src/main.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/main.c b/src/main.c index fb20f1d..4b6d17d 100644 --- a/src/main.c +++ b/src/main.c @@ -338,6 +338,15 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); } + /* + * Evaluate configuration + */ + if (evaluate() == -1) { + dlog(LOG_ERR, "conntrackd cannot start, please review your " + "configuration"); + exit(EXIT_FAILURE); + } + if (type == REQUEST) { if (do_local_request(action, &conf.local, local_step) == -1) { dlog(LOG_ERR, "can't connect: is conntrackd " @@ -382,17 +391,6 @@ int main(int argc, char *argv[]) } } - /* - * Evaluate configuration - */ - if (evaluate() == -1) { - dlog(LOG_ERR, "conntrackd cannot start, please review your " - "configuration"); - close_log(); - unlink(CONFIG(lockfile)); - exit(EXIT_FAILURE); - } - /* * initialization process */ -- cgit v1.2.3