Freeradius 1.1.7 no DB handles

steven meyer kristin.schiffer at gmx.de
Fri Nov 9 08:14:26 CET 2007


I have searched now for several weeks, but do not find a solution:
Installed freeradius 1.1.7 on suse
configured mysql on the same server

I can start radiusd fine, I can login into nas, but I want accounting put
into mysql and that just does not work.
My DB-tables are empty, just accounting should be put into it. I do not need
anything in usergroup for accounting etc, or do I?

radiusd -X | grep sql :

Config:   including file: /usr/local/etc/raddb/sql.conf
 sql: driver = "rlm_sql_mysql"
 sql: server = "localhost"
 sql: port = ""
 sql: login = "root"
 sql: password = ""
 sql: radius_db = "radiusLOG"
 sql: nas_table = "nas"
 sql: sqltrace = no
 sql: sqltracefile = "/rzf/protokolle/radiusd/sqltrace.sql"
 sql: readclients = no
 sql: deletestalesessions = yes
 sql: num_sql_socks = 5
 sql: sql_user_name = "%{User-Name}"
 sql: default_user_profile = ""
 sql: query_on_not_found = no
 sql: authorize_check_query = "SELECT id, UserName, Attribute, Value, op          
FROM radcheck           WHERE Username = '%{SQL-User-Name}'           ORDER
BY id"
 sql: authorize_reply_query = "SELECT id, UserName, Attribute, Value, op          
FROM radreply           WHERE Username = '%{SQL-User-Name}'           ORDER
BY id"
 sql: authorize_group_check_query = "SELECT
radgroupcheck.id,radgroupcheck.GroupName,radgroupcheck.Attribute,radgroupcheck.Value,radgroupcheck.op 
FROM radgroupcheck,usergroup WHERE usergroup.Username = '%{SQL-User-Name}'
AND usergroup.GroupName = radgroupcheck.GroupName ORDER BY radgroupcheck.id"
 sql: authorize_group_reply_query = "SELECT
radgroupreply.id,radgroupreply.GroupName,radgroupreply.Attribute,radgroupreply.Value,radgroupreply.op 
FROM radgroupreply,usergroup WHERE usergroup.Username = '%{SQL-User-Name}'
AND usergroup.GroupName = radgroupreply.GroupName ORDER BY radgroupreply.id"
 sql: accounting_onoff_query = "UPDATE radacct SET AcctStopTime='%S',
AcctSessionTime=unix_timestamp('%S') - unix_timestamp(AcctStartTime),
AcctTerminateCause='%{Acct-Terminate-Cause}', AcctStopDelay =
'%{Acct-Delay-Time}' WHERE AcctSessionTime=0 AND AcctStopTime=0 AND
NASIPAddress= '%{NAS-IP-Address}' AND AcctStartTime <= '%S'"
 sql: accounting_update_query = "           UPDATE radacct           SET             
FramedIPAddress = '%{Framed-IP-Address}',              AcctSessionTime     =
'%{Acct-Session-Time}',              AcctInputOctets     =
'%{Acct-Input-Gigawords:-0}'  << 32 |                                   
'%{Acct-Input-Octets:-0}',              AcctOutputOctets    =
'%{Acct-Output-Gigawords:-0}' << 32 |                                   
'%{Acct-Output-Octets:-0}'           WHERE AcctSessionId =
'%{Acct-Session-Id}'           AND UserName        = '%{SQL-User-Name}'          
AND NASIPAddress    = '%{NAS-IP-Address}'"
 sql: accounting_update_query_alt = "           INSERT INTO radacct            
(AcctSessionId,    AcctUniqueId,      UserName,              Realm,           
NASIPAddress,      NASPortId,              NASPortType,      AcctStartTime,    
AcctSessionTime,              AcctAuthentic,    ConnectInfo_start,
AcctInputOctets,              AcctOutputOctets, CalledStationId,  
CallingStationId,              ServiceType,      FramedProtocol,   
FramedIPAddress,              AcctStartDelay,   XAscendSessionSvrKey)          
VALUES             ('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}',             
'%{SQL-User-Name}',              '%{Realm}', '%{NAS-IP-Address}',
'%{NAS-Port}',              '%{NAS-Port-Type}',              DATE_SUB('%S',                      
INTERVAL (%{Acct-Session-Time:-0} +                                
%{Acct-Delay-Time:-0}) SECOND),                      
'%{Acct-Session-Time}',              '%{Acct-Authentic}', '',             
'%{Acct-Input-Gigawords:
 -0}' << 32 |              '%{Acct-Input-Octets:-0}',             
'%{Acct-Output-Gigawords:-0}' << 32 |             
'%{Acct-Output-Octets:-0}',              '%{Called-Station-Id}',
'%{Calling-Station-Id}',              '%{Service-Type}',
'%{Framed-Protocol}',              '%{Framed-IP-Address}',              '0',
'%{X-Ascend-Session-Svr-Key}')"
 sql: accounting_start_query = "           INSERT INTO radacct            
(AcctSessionId,    AcctUniqueId,     UserName,              Realm,           
NASIPAddress,     NASPortId,              NASPortType,      AcctStartTime,   
AcctStopTime,              AcctSessionTime,  AcctAuthentic,   
ConnectInfo_start,              ConnectInfo_stop, AcctInputOctets, 
AcctOutputOctets,              CalledStationId,  CallingStationId,
AcctTerminateCause,              ServiceType,      FramedProtocol,  
FramedIPAddress,              AcctStartDelay,   AcctStopDelay,   
XAscendSessionSvrKey)           VALUES             ('%{Acct-Session-Id}',
'%{Acct-Unique-Session-Id}',              '%{SQL-User-Name}',             
'%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port}',             
'%{NAS-Port-Type}', '%S', '0',              '0', '%{Acct-Authentic}',
'%{Connect-Info}',              '', '0', '0',             
'%{Called-Station-Id}', '%{Calling-Station-Id}', '',             
'%{Service-Type}', '%
 {Framed-Protocol}', '%{Framed-IP-Address}',             
'%{Acct-Delay-Time:-0}', '0', '%{X-Ascend-Session-Svr-Key}')"
 sql: accounting_start_query_alt = "UPDATE radacct SET AcctStartTime = '%S',
AcctStartDelay = '%{Acct-Delay-Time}', ConnectInfo_start = '%{Connect-Info}'
WHERE AcctSessionId = '%{Acct-Session-Id}' AND UserName = '%{SQL-User-Name}'
AND NASIPAddress = '%{NAS-IP-Address}'"
 sql: accounting_stop_query = "           UPDATE radacct SET             
AcctStopTime       = '%S',              AcctSessionTime    =
'%{Acct-Session-Time}',              AcctInputOctets    =
'%{Acct-Input-Gigawords:-0}' << 32 |                                  
'%{Acct-Input-Octets:-0}',              AcctOutputOctets   =
'%{Acct-Output-Gigawords:-0}' << 32 |                                  
'%{Acct-Output-Octets:-0}',              AcctTerminateCause =
'%{Acct-Terminate-Cause}',              AcctStopDelay      =
'%{Acct-Delay-Time:-0}',              ConnectInfo_stop   = '%{Connect-Info}'          
WHERE AcctSessionId   = '%{Acct-Session-Id}'           AND UserName         
= '%{SQL-User-Name}'           AND NASIPAddress      = '%{NAS-IP-Address}'"
 sql: accounting_stop_query_alt = "           INSERT INTO radacct            
(AcctSessionId, AcctUniqueId, UserName,              Realm, NASIPAddress,
NASPortId,              NASPortType, AcctStartTime, AcctStopTime,             
AcctSessionTime, AcctAuthentic, ConnectInfo_start,             
ConnectInfo_stop, AcctInputOctets, AcctOutputOctets,             
CalledStationId, CallingStationId, AcctTerminateCause,             
ServiceType, FramedProtocol, FramedIPAddress,              AcctStartDelay,
AcctStopDelay)           VALUES             ('%{Acct-Session-Id}',
'%{Acct-Unique-Session-Id}',              '%{SQL-User-Name}',             
'%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port}',             
'%{NAS-Port-Type}',              DATE_SUB('%S',                  INTERVAL
(%{Acct-Session-Time:-0} +                  %{Acct-Delay-Time:-0}) SECOND),             
'%S', '%{Acct-Session-Time}', '%{Acct-Authentic}', '',             
'%{Connect-Info}',              '%{Acct-Input-Gigawo
 rds:-0}' << 32 |              '%{Acct-Input-Octets:-0}',             
'%{Acct-Output-Gigawords:-0}' << 32 |             
'%{Acct-Output-Octets:-0}',              '%{Called-Station-Id}',
'%{Calling-Station-Id}',              '%{Acct-Terminate-Cause}',             
'%{Service-Type}', '%{Framed-Protocol}', '%{Framed-IP-Address}',             
'0', '%{Acct-Delay-Time:-0}')"
 sql: group_membership_query = "SELECT GroupName FROM usergroup WHERE
UserName='%{SQL-User-Name}'"
 sql: connect_failure_retry_delay = 60
 sql: simul_count_query = ""
 sql: simul_verify_query = "SELECT RadAcctId, AcctSessionId, UserName,                               
NASIPAddress, NASPortId, FramedIPAddress,                               
CallingStationId, FramedProtocol                                FROM radacct                               
WHERE UserName='%{SQL-User-Name}'                                AND
AcctStopTime = 0"
 sql: postauth_query = "INSERT into radpostauth (user, pass, reply, date)
values ('%{User-Name}', '%{User-Password:-Chap-Password}',
'%{reply:Packet-Type}', NOW())"
 sql: safe-characters =
"@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_: /"
rlm_sql (sql): Driver rlm_sql_mysql (module rlm_sql_mysql) loaded and linked
rlm_sql (sql): Attempting to connect to root at localhost:/radiusLOG
rlm_sql (sql): starting 0
rlm_sql (sql): Attempting to connect rlm_sql_mysql #0
rlm_sql (sql): Connected new DB handle, #0
rlm_sql (sql): starting 1
rlm_sql (sql): Attempting to connect rlm_sql_mysql #1
rlm_sql (sql): Connected new DB handle, #1
rlm_sql (sql): starting 2
rlm_sql (sql): Attempting to connect rlm_sql_mysql #2
rlm_sql (sql): Connected new DB handle, #2
rlm_sql (sql): starting 3
rlm_sql (sql): Attempting to connect rlm_sql_mysql #3
rlm_sql (sql): Connected new DB handle, #3
rlm_sql (sql): starting 4
rlm_sql (sql): Attempting to connect rlm_sql_mysql #4
rlm_sql (sql): Connected new DB handle, #4
Module: Instantiated sql (sql) 
rlm_sql (sql): sql_set_user escaped user --> 'kristin'
rlm_sql (sql): There are no DB handles to use! skipped 0, tried to connect 0
  modcall[accounting]: module "sql" returns fail for request 1
rlm_sql (sql): sql_set_user escaped user --> 'kristin'
rlm_sql (sql): There are no DB handles to use! skipped 0, tried to connect 0
  modcall[accounting]: module "sql" returns fail for request 2
rlm_sql (sql): sql_set_user escaped user --> 'kristin'
rlm_sql (sql): There are no DB handles to use! skipped 0, tried to connect 0
  modcall[accounting]: module "sql" returns fail for request 3
rlm_sql (sql): sql_set_user escaped user --> 'kristin'
rlm_sql (sql): There are no DB handles to use! skipped 0, tried to connect 0
  modcall[accounting]: module "sql" returns fail for request 4
rlm_sql (sql): sql_set_user escaped user --> 'kristin'
rlm_sql (sql): There are no DB handles to use! skipped 0, tried to connect 0
  modcall[accounting]: module "sql" returns fail for request 5
rlm_sql (sql): sql_set_user escaped user --> 'kristin'
rlm_sql (sql): There are no DB handles to use! skipped 0, tried to connect 0
  modcall[accounting]: module "sql" returns fail for request 6
rlm_sql (sql): sql_set_user escaped user --> 'kristin'
rlm_sql (sql): There are no DB handles to use! skipped 0, tried to connect 0
  modcall[accounting]: module "sql" returns fail for request 7
....

I tried to create and put sqltrace into my db. That was no problem at all.
But whats the Problem of radiusd? It connects to DB, but cannot insert when
accounting-Data comes in!? I do not know where else to look at. Please help
me!



-- 
View this message in context: http://www.nabble.com/Freeradius-1.1.7-no-DB-handles-tf4757305.html#a13604314
Sent from the FreeRadius - User mailing list archive at Nabble.com.




More information about the Freeradius-Users mailing list