Problem with MySQL and Accouting-On record

Alan DeKok aland at deployingradius.com
Fri Nov 13 14:03:40 CET 2020


On Nov 13, 2020, at 4:15 AM, Ángel L. Mateo <amateo at um.es> wrote:
> 
> 	I'm afraid that the patch doesn't work with my config. I have run the same problem test with the patch applied (now I'm running 3.0.21 with the patch)

  Arg.

> 	I guess the "SELECT true" statement doesn't make the desire behaviour. This is what is shown in the debug (the whole debug in in the attached debug.txt file):
> 
> (3) sql: Executing query: UPDATE radacct SET acctstoptime = FROM_UNIXTIME(1605258058), acctsessiontime	= '1605258058' - UNIX_TIMESTAMP(acctstarttime), acctterminatecause = 'NAS-Reboot' WHERE acctstoptime IS NULL AND nasipaddress   = '155.54.213.6' AND acctstarttime <= FROM_UNIXTIME(1605258058)
> rlm_sql_mysql: Rows matched: 0  Changed: 0  Warnings: 0
> (3) sql: SQL query returned: success
> (3) sql: 0 record(s) updated
> (3) sql: Trying next query...
> (3) sql: EXPAND SELECT true
> (3) sql:    --> SELECT true
> (3) sql: Executing query: SELECT true
> (3) sql: SQL query returned: success
> (3) sql: -1 record(s) updated
> (3) sql: No additional queries configured
> rlm_sql (sql): Released connection (0)
> (3)     [sql] = noop
> (3)   } # accounting = noop

  Yeah.

  In the short term, use Bjorn's suggestion.  You can make it specific to Accounting "on" or "off" packers by checking for them:

	sql
	if (noop && ((Acct-Status-Type == Accounting-On) || (Acct-Status-Type == Accounting-Off)) {
		ok
	}

  I'll see if there's a better way to fix this.  It should really be automatic in the server, instead of "unlang" magic.

  Alan DeKok.




More information about the Freeradius-Users mailing list