<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><DIV>Thankyou very much for your prompt reply. I was referring to this documentation.</DIV>
<DIV> </DIV>
<DIV><A href="http://wiki.freeradius.org/Modules2">http://wiki.freeradius.org/Modules2</A><BR></DIV>
<DIV>>>The xxx_instantiate module is called each time a new instance is started. Generally this >>module is used to establish the data for the instance that needs to be retained during the >>life of the instance. For example, reading the configuration variables. cf_section_parse>>(conf, data, module_config) is used to do this function. </DIV>
<DIV> </DIV>
<DIV>>>Setup struct rlm_xxx_t to hold data that needs to be accessed by all instances of the >>rlm. This data is not necessarily the same for each instance. There is a separate copy >>for each instance. For example, this is the place to store configuration variables that will >>be provided in FreeRADIUS.conf.</DIV>
<DIV> </DIV>
<DIV>It is described like I can have the module specific data in the instance and use it in the life time of the instance. </DIV>
<DIV> </DIV>
<DIV>So if I need to use a unique socket connection for each thread, I have no place to store the instance specific data ? I need to have a global pool and lock it with mutex ?? (looks like rlm_ldap does something similar ?)</DIV>
<DIV> </DIV>
<DIV>Thanks in advance</DIV>
<DIV>LK</DIV>
<DIV> </DIV>
<DIV>--- On <B>Fri, 2/19/10, Doug Hardie <I><bc979@lafn.org></I></B> wrote:<BR></DIV>
<BLOCKQUOTE style="BORDER-LEFT: rgb(16,16,255) 2px solid; PADDING-LEFT: 5px; MARGIN-LEFT: 5px"><BR>From: Doug Hardie <bc979@lafn.org><BR>Subject: Re: modules instantiation<BR>To: "FreeRadius users mailing list" <freeradius-users@lists.freeradius.org><BR>Date: Friday, February 19, 2010, 3:49 PM<BR><BR>
<DIV class=plainMail><BR>On 19 February 2010, at 15:24, Latha Krishnamurthi wrote:<BR>> <BR>> 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.<BR>> <BR>> 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.<BR>> <BR>> But it seems that the socket id is the same for all the instances. *instance seems to be shared by all the instances ??<BR>> <BR>> Am I missing
something/configuration, your help is grately appreciated.<BR><BR>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:<BR><BR>* If the module needs to temporarily modify it's instantiation<BR>* data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.<BR>* The server will then take care of ensuring that the module<BR>* is single-threaded.<BR><BR><BR><BR>-<BR>List info/subscribe/unsubscribe? See <A href="http://www.freeradius.org/list/users.html" target=_blank>http://www.freeradius.org/list/users.html</A><BR></DIV></BLOCKQUOTE></td></tr></table><br>