mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 16:46:28 +00:00
Improve logging of configuration file operations
This commit is contained in:
2
config.c
2
config.c
@@ -46,7 +46,7 @@ parse_config(const char *config_file, t_configuration_options *options)
|
|||||||
char config_file_buf[MAXLEN];
|
char config_file_buf[MAXLEN];
|
||||||
char name[MAXLEN];
|
char name[MAXLEN];
|
||||||
char value[MAXLEN];
|
char value[MAXLEN];
|
||||||
bool config_file_provided = true;
|
bool config_file_provided = false;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
||||||
/* Sanity checks */
|
/* Sanity checks */
|
||||||
|
|||||||
15
repmgr.c
15
repmgr.c
@@ -404,10 +404,12 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (runtime_options.verbose)
|
if (runtime_options.verbose && runtime_options.config_file[0])
|
||||||
/* Logging is not yet set up, so using printf() */
|
{
|
||||||
printf(_("Opening configuration file: %s\n"),
|
|
||||||
runtime_options.config_file);
|
log_notice(_("Opening configuration file: %s\n"),
|
||||||
|
runtime_options.config_file);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The configuration file is not required for some actions (e.g. 'standby clone'),
|
* The configuration file is not required for some actions (e.g. 'standby clone'),
|
||||||
@@ -1053,7 +1055,6 @@ do_standby_clone(void)
|
|||||||
exit(ERR_BAD_CONFIG);
|
exit(ERR_BAD_CONFIG);
|
||||||
}
|
}
|
||||||
|
|
||||||
log_debug(_("standby clone: %i tuples\n"), PQntuples(res));
|
|
||||||
for (i = 0; i < PQntuples(res); i++)
|
for (i = 0; i < PQntuples(res); i++)
|
||||||
{
|
{
|
||||||
if (strcmp(PQgetvalue(res, i, 0), "data_directory") == 0)
|
if (strcmp(PQgetvalue(res, i, 0), "data_directory") == 0)
|
||||||
@@ -2276,12 +2277,12 @@ run_basebackup()
|
|||||||
termPQExpBuffer(¶ms);
|
termPQExpBuffer(¶ms);
|
||||||
|
|
||||||
log_info(_("Executing: '%s'\n"), script);
|
log_info(_("Executing: '%s'\n"), script);
|
||||||
r = system(script);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* As of 9.4, pg_basebackup et al only ever return 0 or 1
|
* As of 9.4, pg_basebackup et al only ever return 0 or 1
|
||||||
*/
|
*/
|
||||||
log_debug(_("r = %i, %i\n"), r, WEXITSTATUS(r));
|
|
||||||
|
r = system(script);
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user