Summary:ASTERISK-22871: cel_pgsql module not loading after "reload" or "reload cel_pgsql.so" command
Reporter:Matteo (mpiazzatnetbug)Labels:
Date Opened:2013-11-20 11:28:24.000-0600Date Closed:2014-01-03 16:03:04.000-0600
Versions:11.2.0 11.5.0 Frequency of
Environment:Debian 6.0.7 virtualized on Proxmox 3.1 (KVM) Memory 1Gb CPU 2.27 GHz (1 socket)Attachments:
Description:Running the command "reload cel_pgsql.so" (or simply "reload") from the asterisk CLI the cel_pgsql.so module is not reloaded, it is just unloaded.

Looking quickly through the code of the cel/cel_pgsql.c module I have seen that the execution of the "reload" command ends up in the else if (cfg == CONFIG_STATUS_FILEUNCHANGED) condition reported below.

You can find pasted below the snippet of the code I mentioned before, it could be helpful.
       if ((cfg = ast_config_load(config, config_flags)) == NULL || cfg == CONFIG_STATUS_FILEINVALID) {
               ast_log(LOG_WARNING, "Unable to load config for PostgreSQL CEL's: %s\n", config);
               return AST_MODULE_LOAD_DECLINE;
       } else if (cfg == CONFIG_STATUS_FILEUNCHANGED) {
/*                ast_log(LOG_WARNING, "I go here !!!!!!!!!!\n");*/
               return AST_MODULE_LOAD_SUCCESS;
Comments:By: Matt Jordan (mjordan) 2013-11-20 12:45:53.375-0600

If the config file is not changed, the module is not reloaded. That is entirely expected behavior.

Are you saying that you modified the config file, issued a reload, and nothing occurred?

By: Richard Mudgett (rmudgett) 2013-11-20 17:29:17.923-0600

I looked at the code and cel_pgsql.c does its reload handling stupidly.  It unconditionally unloads the module then tries to load the module.  If the config file has not changed, the load is skipped.

By: Matteo (mpiazzatnetbug) 2013-11-21 01:38:30.852-0600

The behavior is exactly as described from Richard. It always does the unload, also if nothing has changed in the config files, and the load is skipped.

By: Matt Jordan (mjordan) 2013-11-21 09:10:49.403-0600

Lovely. :-(