Fix for 0000299: Errors on the reloading of configuration
authorMuhammad Usama <m.usama@gmail.com>
Wed, 12 Apr 2017 14:29:55 +0000 (19:29 +0500)
committerMuhammad Usama <m.usama@gmail.com>
Wed, 12 Apr 2017 14:29:55 +0000 (19:29 +0500)
Pgpool-II should load the hba_file after evaluating all the command line
options at startup.
It is wrong to load hba file before evaluating all the command line arguments,
because when the Pgpool-II is invoked with reload or stop options, all it
needs to do is to signal the running Pgpool-II and exit, So loading hba file
for pgpool reload/stop is not only unnecessary but It also emits the
misleading WARNING message of "failed while loading hba configuration"
when alternative path for hba file was used.

main.c

diff --git a/main.c b/main.c
index 352041fb352974d5179720cf78b77f2405f004e4..619347240767b5b1f4c55c2713b3b3b14a4ac503 100644 (file)
--- a/main.c
+++ b/main.c
@@ -352,9 +352,6 @@ int main(int argc, char **argv)
                pool_config->logsyslog = 1;
        }
 
-       if (pool_config->enable_pool_hba)
-               load_hba(hba_file);
-
        /*
         * If a non-switch argument remains, then it should be either "reload" or "stop".
         */
@@ -421,6 +418,9 @@ int main(int argc, char **argv)
                exit(1);
        }
 
+       if (pool_config->enable_pool_hba)
+               load_hba(hba_file);
+
        /* check effective user id for watchdog */
        /* watchdog must be started under the privileged user */
        if (pool_config->use_watchdog )