modules instantiation

Doug Hardie bc979 at lafn.org
Sat Feb 20 00:49:12 CET 2010


On 19 February 2010, at 15:24, Latha Krishnamurthi wrote:
> 
> I am using the free radius 2.1.3. I have a module rlm_xxx and have initialized it as thread safe. I have configured the start_servers as 3. The issue I am having is as follows.
>  
> I see that a new instance is getting created when the first one is busy handling a request. (I do this this by adding a sleep in the module and printing the threadid) I am expecting the xxx_instantiate function to get called each time a new instance is created (reading in the documentation). This does not happen. I am actually connecting to a server in the instantiate function and storing the socket id in the *instance, so that I can use it later in the authenticate etc.
>  
> But it seems that the socket id is the same for all the instances. *instance seems to be shared by all the instances ??
>  
> Am I missing something/configuration, your help is grately appreciated.

I believe this is an issue of terminology.  Instantiation in this case refers to the configuration process prior to the start of the server accepting Radius requests.  It does not refer to instantiation of new threads.  I am not aware of any hook you can use for instatiation of new threads.  In one of the older version rlm_example files is the following comment:

 *      If the module needs to temporarily modify it's instantiation
 *      data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
 *      The server will then take care of ensuring that the module
 *      is single-threaded.






More information about the Freeradius-Users mailing list