accounting to db - duplicate entrys & missing stop time?

Roger Kristiansen roger.kristiansen at cc.uit.no
Mon Jul 18 11:06:14 CEST 2005


Alan DeKok wrote:

>>Can I get freeradius to log every "Alive" message to the database,
>>so that I at least know when the last "Alive" was received?
>>    
>>
>
>  See "accounting_update_query", which is run for Alive (i.e.
>Interim-Update) packets.
>  
>
Ok, thanks for clearing up a few things. We seem to have gotten things 
working almost like we wanted to now. But I have one new question 
regarding the Alive-messages and duplicate entries. I suspect this might 
have more to do with postgresql than freeradius, but anyway:

For some (quite a few, actually) session, we get two almost identical 
entries.

Could this be because freeradius does something like this:

1) Receives a Start packet and inserts a new entry/session in the db
2) Receives Alive packet _immediately_ after the Start packet, and 
queries the database to see if the unique-session-id already exists.
3) The query doesn't return anything, since postgresql hasn't had time 
to complete the INSERT-query for the Start packet, and 
accounting_update_query_alt is thus run.

If this is the case, is there any way to fix this behaviour in either 
freeradius or postgresql? I guess limiting freeradius to one connection 
would fix it, but..  :)

Regards,
Roger Kristiansen



More information about the Freeradius-Users mailing list