diff --git a/repmgrd.c b/repmgrd.c index 7dd5c38d..383315da 100644 --- a/repmgrd.c +++ b/repmgrd.c @@ -202,6 +202,17 @@ main(int argc, char **argv) } } + /* + * Read the configuration file: repmgr.conf + */ + parse_config(config_file, &local_options); + if (local_options.node == -1) + { + log_err(_("Node information is missing. " + "Check the configuration file, or provide one if you have not done so.\n")); + terminate(ERR_BAD_CONFIG); + } + if (daemonize) { do_daemonize(); @@ -216,17 +227,6 @@ main(int argc, char **argv) setup_event_handlers(); #endif - /* - * Read the configuration file: repmgr.conf - */ - parse_config(config_file, &local_options); - if (local_options.node == -1) - { - log_err(_("Node information is missing. " - "Check the configuration file, or provide one if you have not done so.\n")); - terminate(ERR_BAD_CONFIG); - } - fd = freopen("/dev/null", "r", stdin); if (fd == NULL) {