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 64d038c823
commit d1b4280182
7 changed files with 141 additions and 86 deletions

View File

@@ -24,6 +24,7 @@
#include "strutil.h"
#define CONFIG_FILE_NAME "repmgr.conf"
typedef struct EventNotificationListCell
{
@@ -97,7 +98,7 @@ typedef struct ErrorList
void set_progname(const char *argv0);
const char * progname(void);
bool load_config(const char *config_file, t_configuration_options *options, char *argv0);
bool load_config(const char *config_file, bool verbose, t_configuration_options *options, char *argv0);
bool reload_config(t_configuration_options *orig_options);
bool parse_config(t_configuration_options *options);
void parse_line(char *buff, char *name, char *value);