How do I see if the user has disconnected?

Mark Antony mark.antony.4 at protonmail.com
Sat May 15 14:16:03 CEST 2021


Thank you that was very helpful.

I just tried it and it works. And I tried a second use case, where instead of stopping the user session, I turned on the AirPlane Mode and cut off the internet.

Freeradius didn't register that as Stop

(11)   accounting {
(11)     if (&Acct-Status-Type == "Stop") {
(11)     if (&Acct-Status-Type == "Stop")  -> FALSE

So I've added the Failed, which didn't work either.

(4)   accounting {
(4)     if (&Acct-Status-Type == "Stop") {
(4)     if (&Acct-Status-Type == "Stop")  -> FALSE
(4)     if (&Acct-Status-Type == "Failed") {
(4)     if (&Acct-Status-Type == "Failed")  -> FALSE


Docs say: https://freeradius.org/rfc/rfc2866.html#Acct-Status-Type

Seems like "Reserved for Failed" is the one, but that string is rejected right away by Freeradius and doesn't startup.


Thanks



Sent with ProtonMail Secure Email.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Saturday, 15 May 2021 12:40, Matthew Newton <mcn at freeradius.org> wrote:

> 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
>
> --------
>
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html





More information about the Freeradius-Users mailing list