DB handles dying slowly

Milan Holub holub at thenet.ch
Wed May 16 14:27:59 CEST 2007


Hi all,

On Wed, May 16, 2007 at 02:05:09PM +0200, Milan Holub wrote:
 
> Currently the only thing which helps is to restart freeradius. It
> creates the DB handles again and works fine for another several hours up to
> days...
> 

I have following nasty "workaround" which react on rlm_sql module failure and
performs restart of freeradius, it's sort of "cutting the branch under
yourself", but it works for me: on first module failure the freeradius
is restarted and the service is almost uninterrupted. I'm posting it
here since the idea of "module failure detection" and succesful action
could be useful for someone...

first of all let's define the script which performs freeradius restart:
...
in modules{} section of radiusd.conf:

        exec forcerestart {
                program = "${raddbdir}/force_restart.sh"
                wait = no
                input_pairs = none
                shell_escape = no
        }

and the scrip itself:
>>force_restart.sh
#!/bin/bash

/bin/echo FORCERESTART
/usr/local/bin/svc -t /service/freeradius
>>force_restart.sh
Please note that freerad user has to have permissions to issue the
commands in force_restart.sh.

Then every occurence of sql module "call" I've replaced by following
configurable failover section:

        group {
                sql {
                        fail = 1
                        ok = return
                }
                forcerestart
        }

That's it!

However any comments/experience/suggestions to the cause of "DB handles
dying" are welcome!


Milan Holub
holub (at) thenet (dot) ch

--------------------------------------
 TheNet-Internet Services AG,
 im Bernertechnopark, Morgenstr. 129
 CH-3018, Bern, Switzerland
 031 998 4333, Fax 031 998 4330
 http://www.thenet.ch
 http://wlan.thenet.ch
--------------------------------------



More information about the Freeradius-Users mailing list