Post Logout/Session timeout SQL

Marc Phillips rmarc at copacetic.net
Sun Mar 27 01:12:25 CET 2011


> Why not define a trigger in the database to run the additional query or
> a function that can perform the necessary checks and the execute a
> query.

I'll take a look at some triggers and stored procedures to go along
with it.  Would be useful for cleaning up stuff anyway (running
radius and chilli on a wireless router, so space is at a premium).

I got the inital criteria done by doing an inner join on the

        accounting_stop_query = " \
          UPDATE ${acct_table2} INNER JOIN ${authcheck_table} USING (username) SET \                                                                                                             ${acct_table2}.acctstoptime       = '%S', \                                                                                                                                         ${acct_table2}.acctsessiontime    = '%{Acct-Session-Time}', \
             ${acct_table2}.acctinputoctets    = '%{%{Acct-Input-Gigawords}:-0}' << 32 | \
                                  '%{%{Acct-Input-Octets}:-0}', \
             ${acct_table2}.acctoutputoctets   = '%{%{Acct-Output-Gigawords}:-0}' << 32 | \
                                  '%{%{Acct-Output-Octets}:-0}', \
             ${acct_table2}.acctterminatecause = '%{Acct-Terminate-Cause}', \
             ${acct_table2}.acctstopdelay      = '%{%{Acct-Delay-Time}:-0}', \
             ${acct_table2}.connectinfo_stop   = '%{Connect-Info}', \
             ${authcheck_table}.disabled       = 1 \
          WHERE ${acct_table2}.acctsessionid   = '%{Acct-Session-Id}' \
          AND ${acct_table2}.username          = '%{SQL-User-Name}' \
          AND ${acct_table2}.nasipaddress      = '%{NAS-IP-Address}'"

R. Marc



More information about the Freeradius-Users mailing list