rlm_perl DBI problems

Borislav Dimitrov b.dimitrov at ngsystems.net
Sat May 2 18:28:24 CEST 2009


Hi,

Frankly, I don't remember exactly your previous post (and don't have  
the time to dig them up now) but here are some things that you should  
check:
1) Is your Perl compiled with multi threading support (perl -V | grep  
multi) # ...useithreads=undef/define
If your Perl i multi threaded, then rlm_perl will also be and so you  
should create all resources which should be private (DB / File handles  
etc) in the CLONE subroutine of your rlm_perl module. This way each  
thread gets its separate DB handle
[as far as I can remember you Perl wasn't multi threaded but anyways]
2) Have you dealt with your DB connection expiring in your code? DB  
connections expire when not used for a given period. FR & rlm_perl  
create persistent DB connections (as modperl does eg) which is good  
but can lead to strange errors e.g. each monday morning when the  
connections has timed out because of not being used during the weekend  
and ... CaBooM ;-).
Try searching for some modules on CPAN for dealing with this or write  
your own (I have one and I'd give it to you if it wasn't so ugly,  
buggy and designed to do something else - switching to a backup DB).  
If you go that route recheck how eval works (to handle exceptions) and  
the ping DBI method could be useful too too.


On 01.05.2009, at 12:17, Alexander Kosykh wrote:

> Thnx for your answer.
> And there can I ask about perl module?
>
> -----Original Message-----
> From: freeradius-users-bounces+avkosykh=gmail.com at lists.freeradius.org
> [mailto:freeradius-users-bounces+avkosykh=gmail.com at lists.freeradius.org 
> ] On
> Behalf Of Ivan Kalik
> Sent: Thursday, April 30, 2009 9:48 PM
> To: FreeRadius users mailing list
> Subject: RE: rlm_perl DBI problems
>
>> Back to my problem with perl
>> Then I comment my own module rejectlog in sites-enable/mysite FR  
>> begin to
>> work fine at least 18 hours.
>> Some ideas why it can bring an error in DBI if it's sub function in  
>> perl
>> don't use DBI at all?
>
> Please don't ask perl debugging questions on this list.
>
>> Any other offers how to log reject users in special format?
>>
>
> rlm_linelog.
>
>> I don't want log rejected user in radius.log file. In my case it for
>> radius
>> system log - not for users. I've try to turn on log only  
>> badpassword users
>> but it log all good and bad password users L bug in FR?
>> Thers part of my config
>> log {
>> destination = files
>> file = ${logdir}/radius.log
>> stripped_names = no
>> auth = yes
>> auth_badpass = yes
>> auth_goodpass = no
>> }
>
> This will log only usernames for good login and username + password  
> for
> bad passwords/wrong username/etc. If you don't want good logins -  
> run a
> cron job that deletes all the lines containing Login OK.
>
> Ivan Kalik
> Kalik Informatika ISP
>
> -
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/users.html
>
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html




More information about the Freeradius-Users mailing list