Re: Non-Breaking Accounting Response Handling

Nathan Ward <[email protected]>
Newsgroups gmane.comp.freeradius.user
Message-ID <CACx0ryYcDR6mZf7T9j6sDANK5=zFQewFvGj+LRUg+QMJVcnvrA@mail.gmail.com>
Hi null?,

On 13 Mar 2025 at 2:02:32 PM, (null) (null) via Freeradius-Users <
[email protected]> wrote:

> I have the accounting {} setting in /etc/raddb/sites-available/default.
> How can I prevent this configuration from breaking the accounting response
> if an SQL connection error occurs or radutmp fails to write to the file?
> The accounting response should continue even if there are logging errors.
>
> accounting {
> if ("%{User-Name}" =~ /@/) {
> radutmp
> sql_Fradius_log
>     }
> exec
> attr_filter.accounting_response
> log_accounting
> }
>
> FreeRADIUS Version 3.2.7
>
>
This is probably what you are looking for:
https://wiki.freeradius.org/config/Fail-over#rewriting-results-for-single-modules

This means that if SQL fails, you still reply and the SQL is never done.


You may also want to look at the buffered-sql example, where during a
failure of SQL, you can write to a buffer file, and then respond to the
accounting message. The messages in this file is then read in and processed
as though the messages have been freshly received. In this way, you get the
SQL work done when it starts working again.

https://github.com/FreeRADIUS/freeradius-server/blob/release_3_2_7/raddb/sites-available/buffered-sql

--
Nathan Ward
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.