Adding a NAS via SQL

Claudiu Filip claudiu at globtel.ro
Mon Jul 30 18:13:13 CEST 2007



Hi Paul,

Saturday, July 28, 2007, 6:08:23 PM, you wrote:
> I however just tried hitting radiusd with a SIGHUP and it really
> didn't like it.... Output attached, I just got a segfault when I hit it with the next radius request.

Currently, I'm able to run a SIGHUPed  freeradius 20070420 snapshot,
with postgresql backend.

If you search through the archives, I've sent a rude email to the list
back in March 2007 (containing 3 questions in one message)..
I'm sorry for that email, but I'll be very happy (even now) to get an
advice about the workarounds.
The server seems to run ok so far, without any problems but I didnt
put too much stress on it.

My solution to let the freeradius handle a SIGHUP was:
1)
>       I solved this problem by commenting out the "we do other magic"
>      in mainconfig.c lines 1059->1064. This will disable debug level
>      change on the fly facility, it's not that important anyway

2)
> clients.c
> -       if (clients) return clients;
> +       if (clients) clients_free(clients);
> mainconfig.c
> -        clients_free(old_clients);
> +        if ((void *)old_clients != (void *)clients)
> +                  clients_free(old_clients);
>     solved the problem.
>     Do I still need the clients_free(old_clients)?


>> Is there a way to automatically activate a new NAS device that I add to
>> the SQL database?
> cron ;-)

My advice is to create a database trigger on INSERTs, UPDATEs,
DELETEs.
For example, my postgresql trigger written in plperlu:

CREATE OR REPLACE FUNCTION restart_radiusd() RETURNS TRIGGER AS $rr_rad$
        system("/usr/bin/sudo /usr/bin/killall -HUP radiusd");
        return;
$rr_rad$ LANGUAGE plperlu;
DROP TRIGGER IF EXISTS need_to_restart_radiusd ON nas_table;
CREATE TRIGGER need_to_restart_radiusd AFTER INSERT OR UPDATE OR DELETE ON nas_table
FOR EACH STATEMENT EXECUTE PROCEDURE restart_radiusd();

/etc/sudoers:
postgresqluser      ALL=(radiususer) NOPASSWD: /usr/bin/killall -HUP radiusd


This way, you will restart freeradius only when needed.
You said that your backend is mysql, you will probably be able to come
up with the mysql version, but your main issue is not that.
SIGHUP must work.



Best regards,

Claudiu Filip
@: claudiu at globtel.ro
Http://www.globtel.ro
T:+40344880100
F:+40344880113





More information about the Freeradius-Users mailing list