Add /etc/repmgr.conf as a default configuration file location

Also refactor configuration file handling while we're at it.

Previously a configuration file would be ignored if it couldn't
be opened, however that is now treated as an error.
This commit is contained in:
Ian Barwick
2015-11-19 15:16:18 +09:00
parent f64c42a514
commit ce3594d52d
7 changed files with 141 additions and 86 deletions

View File

@@ -68,7 +68,7 @@ t_configuration_options master_options;
PGconn *master_conn = NULL;
char *config_file = DEFAULT_CONFIG_FILE;
char *config_file = "";
bool verbose = false;
bool monitoring_history = false;
t_node_info node_info;
@@ -199,7 +199,7 @@ main(int argc, char **argv)
* which case we'll need to refactor parse_config() not to abort,
* and return the error message.
*/
load_config(config_file, &local_options, argv[0]);
load_config(config_file, verbose, &local_options, argv[0]);
if (daemonize)
{