How do I see if the user has disconnected?

Matthew Newton mcn at freeradius.org
Sat May 15 13:40:52 CEST 2021



On 15/05/2021 08:46, Mark Antony via Freeradius-Users wrote:
> I have made further progress and believe this could be a solution.
> But it seems I have a syntax issue:
> 
> accounting {
>          switch "%{Acct-Status-Type}" {
>              case 'Stop' {
>                  query = "SELECT TRUE;"
>              }
>          }
> 
> Error:
> 
> /etc/freeradius/3.0/sites-enabled/default[650]: Unknown action 'SELECT TRUE;'.

That's configuration for rlm_sql, not unlang. You can't mix the two.

Try something like

accounting {
   if (&Acct-Status-Type == "Stop") {
     if ("%{sql:SELECT TRUE}" == "") {
       noop
     }
   }
}

You could also just modify the queries in e.g. 
raddb/mods-config/sql/main/mysql/queries.conf

-- 
Matthew


More information about the Freeradius-Users mailing list