rlm_perl hang server

Boyan Jordanov bjordanov at orbitel.bg
Mon Oct 10 14:50:47 CEST 2005


On Monday 10 October 2005 10:41, Abdul Lateef wrote:
> Hi,
>
> i am not using sql.conf at all. i have only DB
> connection in example.pl file. 

Sure. What i want to say is to use sub CLONE to create connection for each 
thread like this. 

example.pl
--//--

sub CLONE {
my $db =
"dbi:mysql:dbname=${db_name};host=${db_host}";
        my $dbv = DBI->connect($db, $db_user, $db_pass,
                 { RaiseError => 1, AutoCommit => 0 }
        ) || die "Error connecting to the database";

}
 --//--

This way every perl thread will have its own sql connection. 
function CLONE is called *automatically* when new perl thread is created. 


-- 
Best Regards,
Boian Jordanov
SNE
Orbitel - Next Generation Telecom
tel. +359 2 4004 723 
tel. +359 2 4004 002



More information about the Freeradius-Users mailing list