So I am in the process of upgrading from freeradius 1.x to 2.x. I have scripts that check if my radius configuration is correct before I actually run radiusd. I'm more specifically interested in checking if my fastusers file syntax is correct before loading it. I found out that by running radiusd -n radiusd-test -C -X it wouldn't check my fastusers module at all. Module: Linked to module rlm_fastusers Module: Skipping instantiation of fastusers After some more digging I found that the module needs to have a type flag of "RLM_TYPE_CHECK_CONFIG_SAFE" for it to check. Now I'm not sure if I should just blindly change the source code and add this flag in the module or not. Should I just try it and report back if it works?
Gabriel Blanchard wrote:
So I am in the process of upgrading from freeradius 1.x to 2.x. I have scripts that check if my radius configuration is correct before I actually run radiusd. I'm more specifically interested in checking if my fastusers file syntax is correct before loading it.
In 2.x, there is no benefit to using "fastusers". The "users" file code has been updated to use hash tables internally. It does everything the "fastusers" file does.
I found out that by running radiusd -n radiusd-test -C -X it wouldn't check my fastusers module at all.
Module: Linked to module rlm_fastusers Module: Skipping instantiation of fastusers
Yes.
After some more digging I found that the module needs to have a type flag of "RLM_TYPE_CHECK_CONFIG_SAFE" for it to check. Now I'm not sure if I should just blindly change the source code and add this flag in the module or not. Should I just try it and report back if it works?
That may work. Realistically, the "fastusers" module should be deleted. Please try using the "files" module instead. Alan DeKok.
On 21-Jan-09, at 10:03 AM, Alan DeKok wrote:
Gabriel Blanchard wrote:
So I am in the process of upgrading from freeradius 1.x to 2.x. I have scripts that check if my radius configuration is correct before I actually run radiusd. I'm more specifically interested in checking if my fastusers file syntax is correct before loading it.
In 2.x, there is no benefit to using "fastusers". The "users" file code has been updated to use hash tables internally. It does everything the "fastusers" file does.
Oh, I had no idea thanks.
After some more digging I found that the module needs to have a type flag of "RLM_TYPE_CHECK_CONFIG_SAFE" for it to check. Now I'm not sure if I should just blindly change the source code and add this flag in the module or not. Should I just try it and report back if it works?
That may work.
Realistically, the "fastusers" module should be deleted. Please try using the "files" module instead.
Well I already tried it and its working. Here is the stupidly short patch --- src/modules/rlm_fastusers/rlm_fastusers.c 2009-01-21 09:52:39.000000000 -0500 +++ src/modules/rlm_fastusers/rlm_fastusers.c 2009-01-21 09:53:05.000000000 -0500 @@ -783,7 +783,7 @@ module_t rlm_fastusers = { RLM_MODULE_INIT, "fastusers", - 0, /* type: reserved */ + RLM_TYPE_CHECK_CONFIG_SAFE, /* type: RLM_TYPE_CHECK_CONFIG_SAFE */ fastuser_instantiate, /* instantiation */ fastuser_detach, /* detach */ { Does the users module also reload the users file every x seconds like the fastusers module? This is specifically what I want. -Gabriel
Gabriel Blanchard wrote:
Does the users module also reload the users file every x seconds like the fastusers module? This is specifically what I want.
No. You need to HUP the server. Or, you can use radmin: radmin -e "hup files" which will reload *just* the "files" module. This can be done from a cron job, if necessary. See raddb/sites-available/control-socket. Alan DeKok.
participants (2)
-
Alan DeKok -
Gabriel Blanchard