Info: rlm_sql (sql): There are no DB handles to use! skipped 0, tried to connect 0

Ivan Kalik tnt at kalik.net
Mon Oct 12 16:32:14 CEST 2009


> accounting {
>                if (Acct-Status-Type == Start) {
>                        update reply {
>                              Tmp-String-0 =
> "%{exec:/etc/freeradius/SCRIPT/userlogin.py %{User-Name}}"
>                         }
>                 }
>                 if (Acct-Status-Type == Stop) {
>                         update reply {
>                              Tmp-String-0 =
> "%{exec:/etc/freeradius/SCRIPT/userlogout.py %{User-Name}}"
>                         }
>                }

You can replace call to exec module by call to sql:

Tmp-String-0 = "%{sql:UPDATE whatever}"

Current server versions should support UPDATEs and INSERTs as well as
SELECTs which vere only ones supported in early 2.x versions.

> I need to launch a script with after login and logout.
>
> Maybe this script cause some problems? It's a simple python script that
> update a field in db (online/offiline flag).

Do you need that at all? Instead of calling the database to see if the
flag (wherever you are using it) is set you can make a query that checks
if user is online.

Ivan Kalik
Kalik Informatika ISP




More information about the Freeradius-Users mailing list