From da82829659a2f4ce6deaa7affecef913dfc01e59 Mon Sep 17 00:00:00 2001 From: Daniel Farina Date: Thu, 10 Feb 2011 02:10:58 -0800 Subject: [PATCH] Avoid checking config file when performing standby clone action Signed-off-by: Daniel Farina --- repmgr.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/repmgr.c b/repmgr.c index 1b519d1e..1d22cf66 100644 --- a/repmgr.c +++ b/repmgr.c @@ -262,16 +262,21 @@ main(int argc, char **argv) else dbname = "postgres"; } - + /* - * Read the configuration file: repmgr.conf + * Read the configuration file: repmgr.conf, but only if we're not doing a + * STANDBY CLONE action: it is not necessary to have the configuration file + * in that case. */ - parse_config(config_file, &config); - if (config.node == -1) + if (action != STANDBY_CLONE) { - fprintf(stderr, "Node information is missing. " - "Check the configuration file.\n"); - exit(1); + parse_config(config_file, &config); + if (config.node == -1) + { + fprintf(stderr, "Node information is missing. " + "Check the configuration file.\n"); + exit(1); + } } keywords[2] = "user";