mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 08:36:30 +00:00
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:
12
repmgrd.c
12
repmgrd.c
@@ -202,7 +202,7 @@ main(int argc, char **argv)
|
||||
* which case we'll need to refactor parse_config() not to abort,
|
||||
* and return the error message.
|
||||
*/
|
||||
parse_config(config_file, &local_options);
|
||||
load_config(config_file, &local_options, argv[0]);
|
||||
|
||||
if (daemonize)
|
||||
{
|
||||
@@ -313,7 +313,7 @@ main(int argc, char **argv)
|
||||
check_cluster_configuration(my_local_conn);
|
||||
check_node_configuration();
|
||||
|
||||
if (reload_config(config_file, &local_options))
|
||||
if (reload_config(&local_options))
|
||||
{
|
||||
PQfinish(my_local_conn);
|
||||
my_local_conn = establish_db_connection(local_options.conninfo, true);
|
||||
@@ -362,10 +362,10 @@ main(int argc, char **argv)
|
||||
if (got_SIGHUP)
|
||||
{
|
||||
/*
|
||||
* if we can reload, then could need to change
|
||||
* if we can reload the configuration file, then could need to change
|
||||
* my_local_conn
|
||||
*/
|
||||
if (reload_config(config_file, &local_options))
|
||||
if (reload_config(&local_options))
|
||||
{
|
||||
PQfinish(my_local_conn);
|
||||
my_local_conn = establish_db_connection(local_options.conninfo, true);
|
||||
@@ -426,7 +426,7 @@ main(int argc, char **argv)
|
||||
check_cluster_configuration(my_local_conn);
|
||||
check_node_configuration();
|
||||
|
||||
if (reload_config(config_file, &local_options))
|
||||
if (reload_config(&local_options))
|
||||
{
|
||||
PQfinish(my_local_conn);
|
||||
my_local_conn = establish_db_connection(local_options.conninfo, true);
|
||||
@@ -477,7 +477,7 @@ main(int argc, char **argv)
|
||||
* if we can reload, then could need to change
|
||||
* my_local_conn
|
||||
*/
|
||||
if (reload_config(config_file, &local_options))
|
||||
if (reload_config(&local_options))
|
||||
{
|
||||
PQfinish(my_local_conn);
|
||||
my_local_conn = establish_db_connection(local_options.conninfo, true);
|
||||
|
||||
Reference in New Issue
Block a user