Rework config file handling

If no configuration file provided, also check default Postgres
sysconfig dir.

It would also be useful to check the configuration directory
provided by the RPM/DEB packages, not sure if that's programmatically
feasible.
This commit is contained in:
Ian Barwick
2015-09-21 15:55:29 +09:00
parent 65e63b062e
commit 30fd111cba
4 changed files with 61 additions and 35 deletions

View File

@@ -419,7 +419,6 @@ main(int argc, char **argv)
if (runtime_options.verbose && runtime_options.config_file[0])
{
log_notice(_("opening configuration file: %s\n"),
runtime_options.config_file);
}
@@ -429,7 +428,7 @@ main(int argc, char **argv)
* however if available we'll parse it anyway for options like 'log_level',
* 'use_replication_slots' etc.
*/
config_file_parsed = parse_config(runtime_options.config_file, &options);
config_file_parsed = load_config(runtime_options.config_file, &options, argv[0]);
/*
* Initialise pg_bindir - command line parameter will override
@@ -3355,7 +3354,7 @@ do_check_upstream_config(void)
bool config_ok;
int server_version_num;
parse_config(runtime_options.config_file, &options);
parse_config(&options);
/* Connection parameters for upstream server only */
keywords[0] = "host";