share variables in perl script (rlm_perl)

laurent.feron at free.fr laurent.feron at free.fr
Thu Nov 29 23:14:49 CET 2012


Hello,

In a perl script (where authorize() and authenticate() are defined), i was able to set a global variable. when a radius request comes, the script may modify the variable, and the next request has the new value. I test with radiusd -X, and everything is fine.

when radiusd is started as a daemon, 5 threads (default value) are started. And now, i understood i have 5 different perl "environments".
Meaning, when i start the first radtest that modifies the global variable, only the sixth request can view the global variable modified by the first request( i guess the sixth one turns into the first thread).

I hope my explanation is clear. I would like to know if it possible to have a unique sharing enviroment (the basic solution is maybe to have only one thread, but it should be good for performance)

Just for your information, i would like to "cache" some information... the script has to find which OTP server the user is defined on. The second time the search is not necessary... i use Tie::Hash::Expire module for caching information.

Regards,
Laurent 


More information about the Freeradius-Users mailing list