reconnect to mysql on DB write errors

Cypher A cyphera at gmail.com
Mon Apr 25 12:33:33 UTC 2022


I can’t find anything in rlm_sql that could kill the current connection. I also tested to use an exec xlat to run a script to kill and restart the current radiusd process. Really interesting that this works when radiusd is running in debug mode. But not when it’s running under systemd .. 

What’s the proper way to do this?? 

> On Apr 11, 2022, at 8:35 PM, Terry Burton <tez at terryburton.co.uk> wrote:
> 
> 
>> On Mon, 11 Apr 2022, 11:32 Terry Burton, <tez at terryburton.co.uk> wrote:
>>> On Mon, 11 Apr 2022, 11:17 Cypher A, <cyphera at gmail.com> wrote:
>>> thanks, that seems to be exactly what I need. though it's unclear how to trigger current sql connections to drop and reconnect?
>>> is it just by setting db_online to fail??
>> 
>> 
>> No. That's just a "variable".
>> 
>> You can probably use an rlm_sql xlat in the resource_check virtual server to run a command to quit or kick the correct connect.
> 
> 
> * kick the current session.
> 
> 
>>>> On Mon, Apr 11, 2022 at 5:47 PM Terry Burton <tez at terryburton.co.uk> wrote:
>>>>> On Mon, 11 Apr 2022, 07:38 Cypher A, <cyphera at gmail.com> wrote:
>>>>> Is there a way / config option for freeRadius to reconnect to sql server on
>>>>> DB operation errors (eg. db write errors).
>>>> 
>>>> 
>>>> Yes: https://github.com/FreeRADIUS/freeradius-server/blob/v3.0.x/raddb/sites-available/resource-check
>>>> 
>>>> 


More information about the Freeradius-Users mailing list