Fix for 0000299: Errors on the reloading of configuration
authorMuhammad Usama <m.usama@gmail.com>
Wed, 12 Apr 2017 14:02:03 +0000 (19:02 +0500)
committerMuhammad Usama <m.usama@gmail.com>
Wed, 12 Apr 2017 14:02:03 +0000 (19:02 +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.

src/main/main.c

index e3367aa7d58f09135e31c71ddb66ff65da023034..e8480c6867240e9a029fa44023fd88b472280bf8 100644 (file)
@@ -204,9 +204,6 @@ int main(int argc, char **argv)
     if(debug_level > 0 && pool_config->log_min_messages > DEBUG1)
         pool_config->log_min_messages = DEBUG1;
 
-       if (pool_config->enable_pool_hba)
-               load_hba(hba_file);
-
        /*
         * If a non-switch argument remains, then it should be either "reload" or "stop".
         */
@@ -271,6 +268,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 */
        wd_check_network_command_configurations();