Using multiple databases on the same freeRadius instance
    Gabriel Marais 
    gabriel.j.marais at gmail.com
       
    Wed Feb 15 13:34:18 CET 2017
    
    
  
On 2017/02/15 2:16 PM, Alan DeKok wrote:
> On Feb 15, 2017, at 7:11 AM, Gabriel Marais <gabriel.j.marais at gmail.com> wrote:
>> i then created a new config file with the second db connection details and included the file in radiusd.conf
>
>   Good..
>
>> from the radius debug, i can see it is loading the second config file:-
>> Wed Feb 15 14:00:18 2017 : Debug: including configuration file /etc/freeradius/sql_admindb.conf
>
>   That's good.
>
>> However, no connections are made or no reference is made to the second db config.
When testing with radclient, i see the following in the debug:-
Wed Feb 15 14:13:49 2017 : Info: +++update proxy-request {
Wed Feb 15 14:13:49 2017 : Info: WARNING: Unknown module "sql_admin_db" 
in string expansion "%"
Wed Feb 15 14:13:49 2017 : Info: WARNING: Unknown module "sql_admin_db" 
in string expansion "%"
Wed Feb 15 14:13:49 2017 : Info: WARNING: Unknown module "sql_admin_db" 
in string expansion "%"
Wed Feb 15 14:13:49 2017 : Info: WARNING: Unknown module "sql_admin_db" 
in string expansion "%"
Wed Feb 15 14:13:49 2017 : Info: WARNING: Unknown module "sql_admin_db" 
in string expansion "%"
Wed Feb 15 14:13:49 2017 : Info: WARNING: Unknown module "sql_admin_db" 
in string expansion "%"
The config file for that part looks like :-
--snip
         if(Acct-Status-Type == Start){
                 update proxy-request {
                         subscriberID += "%{sql_admin_db:SELECT 
account_name FROM app_dslaccount WHERE account_name = '%{User-Name}'}"
                         productID += "%{sql_admin_db:SELECT 
current_product_id FROM app_dslaccount WHERE account_name = '%{User-Name}'}"
--snip
My DB Connections file looks like :-
sql_admin_db {
         database = "mysql"
         driver = "rlm_sql_${database}"
         server = "localhost"
         login = "radius"
         password = "L0g1T3ch2017!"
         radius_db = "ionline_adminportal"
         # Print all SQL statements when in debug mode (-x)
         sqltrace = no
         sqltracefile = ${logdir}/sqltrace.sql
         num_sql_socks = ${thread[pool].max_servers}
         connect_failure_retry_delay = 60
         lifetime = 0
         max_queries = 0
}
Thanks for the help...
>
>   Because you didn't *use* the module anywhere.
>
>   List "sql_admin_db" in a virtual server.
>
>   If you don't use the module anywhere, the server notices that, and doesn't open connections to SQL.  Because they would never be used.
>
>   Alan DeKok.
>
>
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
>
    
    
More information about the Freeradius-Users
mailing list