Problem with rlm_perl
Anatoly S. Zimin
anatolyz at team.co.ru
Tue Apr 7 14:54:25 CEST 2009
Да, это точно баг.
У меня была такая проблема, в дебаге работает.
А как только включаешь нормальный режим, (почти)сразу начинаются глюки.
У меня есть предположение - все дело в форках. (как это не мерзко, но у
прекрасного языка perl есть кривые реализации модулей. Которые с багами работают
при форке)
Я решил свои проблемы объединением скриптов и переписал все на более низком
уровне. Т.е. заменил IO::SOcket::Inet на просто Socket. И конечно
исключить такие полезные вещи как fork и threads. Бывает глюки
появляются в новых версиях, может стоит на несколько подверсий откатится попробовать? (как
крайний вариант)
> Ок, я так и сделал.
> Но дело в том что мой радиус будет авторизовывать и считать несколько
> сервисов с разных NAS.
> И очень не плохо было бы их разнести.
> Причем если запускать radius без режима дебага, то он какое то время будет
> работать нормально, правда только какое-то.
> ---------------------------
> Ok, I and have made.
> But the matter is that my radius will be authenticate and acccounting some
> services with different NAS.
> And very much it would be not bad to carry them.
> And if to start radius without a debug mode it what that time will work
> normally, the truth only any.
>
>
>
> ----- Original Message -----
> From: "Anatoly S. Zimin" <anatolyz at team.co.ru>
> To: "FreeRadius users mailing list" <freeradius-users at lists.freeradius.org>
> Sent: Tuesday, April 07, 2009 3:45 PM
> Subject: Re: Problem with rlm_perl
>
>
> > Привет!
> >
> > На самом деле, весьма _неудобно_ искать проблемы просто по дебагу +
> > конфиг.
> > Уж лучше описать её хоть на "ломаном" англ.
> > Это так отступление...
> >
> > А вообще, у rlm_perl весьма много глюков.
> > Например при работе с разными модулями, типа IO::Socket::XXXX.
> > Попробуйте все засунуть в один скрипт.
> >
> >
> >> Hello.
> >>
> >> Config:
> >> perl auth_perl_pppoe {
> >> module = /var/www/radius/radius_auth.pl
> >> func_accounting = accounting
> >> }
> >>
> >> perl acc_perl_pppoe {
> >> module = /var/www/radius/radius_accounting.pl
> >> func_authenticate = authenticate
> >> }
> >>
> >> -----------------------------------------------------------------
> >> authenticate {
> >> Auth-Type PPPOE_AUTH {
> >> auth_perl_pppoe
> >> }
> >>
> >> }
> >>
> >> #
> >> # Accounting. Log the accounting data.
> >> #
> >> accounting {
> >> Acct-Type PPPOE_ACC {
> >> acc_perl_pppoe
> >> }
> >> detail
> >> unix
> >> radutmp
> >> }
> >>
> >>
> >> this error in radiusd -X:
> >>
> >>
> >> rad_recv: Access-Request packet from host 93.95.41.141 port 53773, id=8,
> >> length=146
> >> Service-Type = Framed-User
> >> Framed-Protocol = PPP
> >> NAS-Port = 100
> >> NAS-Port-Type = Ethernet
> >> User-Name = "pppoe_test"
> >> Calling-Station-Id = "00:13:77:60:60:CB"
> >> Called-Station-Id = "internet"
> >> NAS-Port-Id = "e2_v15"
> >> CHAP-Challenge = 0x3b30fc1959ca610275bdc66582b579cf
> >> CHAP-Password = 0x013e0573332525cd3ebc797dbe68f0969d
> >> NAS-Identifier = "ntk-hsgw"
> >> NAS-IP-Address = 93.95.41.141
> >> +- entering group authorize {...}
> >> ++[preprocess] returns ok
> >> [suffix] No '@' in User-Name = "pppoe_test", looking up realm NULL
> >> [suffix] No such realm "NULL"
> >> ++[suffix] returns noop
> >> ++[mschap] returns noop
> >> ++[unix] returns notfound
> >> [files] users: Matched entry DEFAULT at line 1
> >> [files] users: Matched entry DEFAULT at line 7
> >> [files] users: Matched entry DEFAULT at line 19
> >> ++[files] returns ok
> >> ++[logintime] returns noop
> >> [pap] WARNING! No "known good" password found for the user.
> >> Authentication
> >> may fail because of this.
> >> ++[pap] returns noop
> >> Found Auth-Type = PPPOE_AUTH
> >> +- entering group PPPOE_AUTH {...}
> >> GOT CLONE -1209066800 0x91011d8
> >> rlm_perl: Added pair NAS-Port-Type = Ethernet
> >> rlm_perl: Added pair CHAP-Password = 0x013e0573332525cd3ebc797dbe68f0969d
> >> rlm_perl: Added pair Huntgroup-Name = ntk_pppoe
> >> rlm_perl: Added pair Service-Type = Framed-User
> >> rlm_perl: Added pair Called-Station-Id = internet
> >> rlm_perl: Added pair Calling-Station-Id = 00:13:77:60:60:CB
> >> rlm_perl: Added pair Framed-Protocol = PPP
> >> rlm_perl: Added pair User-Name = pppoe_test
> >> rlm_perl: Added pair CHAP-Challenge = 0x3b30fc1959ca610275bdc66582b579cf
> >> rlm_perl: Added pair NAS-Identifier = ntk-hsgw
> >> rlm_perl: Added pair NAS-IP-Address = 93.95.41.141
> >> rlm_perl: Added pair NAS-Port = 100
> >> rlm_perl: Added pair NAS-Port-Id = e2_v15
> >> rlm_perl: Added pair Framed-Protocol = PPP
> >> rlm_perl: Added pair Service-Type = Framed-User
> >> rlm_perl: Added pair Class = dialup
> >> rlm_perl: Added pair Mikrotik-Rate-Limit = 256k
> >> rlm_perl: Added pair Framed-Compression = Van-Jacobson-TCP-IP
> >> rlm_perl: Added pair Auth-Type = PPPOE_AUTH
> >> ++[auth_perl_pppoe] returns ok
> >> Login OK: [pppoe_test] (from client ntk-hsgw port 100 cli
> >> 00:13:77:60:60:CB)
> >> +- entering group post-auth {...}
> >> ++[exec] returns noop
> >> Sending Access-Accept of id 8 to 93.95.41.141 port 53773
> >> Framed-Protocol = PPP
> >> Service-Type = Framed-User
> >> Class = 0x6469616c7570
> >> Mikrotik-Rate-Limit = "256k"
> >> Framed-Compression = Van-Jacobson-TCP-IP
> >> Finished request 0.
> >> Going to the next request
> >> Waking up in 4.9 seconds.
> >> rad_recv: Accounting-Request packet from host 93.95.41.141 port 57551,
> >> id=9,
> >> length=157
> >> Service-Type = Framed-User
> >> Framed-Protocol = PPP
> >> NAS-Port = 100
> >> NAS-Port-Type = Ethernet
> >> User-Name = "pppoe_test"
> >> Calling-Station-Id = "00:13:77:60:60:CB"
> >> Called-Station-Id = "internet"
> >> NAS-Port-Id = "e2_v15"
> >> Class = 0x6469616c7570
> >> Acct-Session-Id = "8170005c"
> >> Framed-IP-Address = 93.95.42.63
> >> Acct-Authentic = RADIUS
> >> Event-Timestamp = "Apr 7 2009 17:07:22 MSD"
> >> Acct-Status-Type = Start
> >> NAS-Identifier = "ntk-hsgw"
> >> NAS-IP-Address = 93.95.41.141
> >> Acct-Delay-Time = 0
> >> +- entering group preacct {...}
> >> ++[preprocess] returns ok
> >> [acct_unique] Hashing 'NAS-Port = 100,Client-IP-Address =
> >> 93.95.41.141,NAS-IP-Address = 93.95.41.141,Acct-Session-Id =
> >> "8170005c",User-Name = "pppoe_test"'
> >> [acct_unique] Acct-Unique-Session-ID = "de65ab6044a69020".
> >> ++[acct_unique] returns ok
> >> [files] acct_users: Matched entry DEFAULT at line 29
> >> ++[files] returns ok
> >> Found Acct-Type PPPOE_ACC
> >> +- entering group PPPOE_ACC {...}
> >> rlm_perl: perl_embed:: module = /var/www/radius/radius_accounting.pl ,
> >> func
> >> = accounting exit status= Undefined subroutine &main::accounting called.
> >> Use of uninitialized value.
> >> rlm_perl: Added pair NAS-Port-Type = Ethernet
> >> rlm_perl: Added pair Acct-Session-Id = 8170005c
> >> rlm_perl: Added pair Service-Type = Framed-User
> >> rlm_perl: Added pair Acct-Unique-Session-Id = de65ab6044a69020
> >> rlm_perl: Added pair Called-Station-Id = internet
> >> rlm_perl: Added pair Acct-Authentic = RADIUS
> >> rlm_perl: Added pair Acct-Status-Type = Start
> >> rlm_perl: Added pair NAS-IP-Address = 93.95.41.141
> >> rlm_perl: Added pair NAS-Port-Id = e2_v15
> >> rlm_perl: Added pair Huntgroup-Name = ntk_pppoe
> >> rlm_perl: Added pair Calling-Station-Id = 00:13:77:60:60:CB
> >> rlm_perl: Added pair Framed-Protocol = PPP
> >> rlm_perl: Added pair User-Name = pppoe_test
> >> rlm_perl: Added pair Event-Timestamp = Apr 7 2009 17:07:22 MSD
> >> rlm_perl: Added pair NAS-Identifier = ntk-hsgw
> >> rlm_perl: Added pair Framed-IP-Address = 93.95.42.63
> >> rlm_perl: Added pair Class = 0x6469616c7570
> >> rlm_perl: Added pair NAS-Port = 100
> >> rlm_perl: Added pair Acct-Delay-Time = 0
> >> rlm_perl: Added pair Acct-Type = PPPOE_ACC
> >> ++[acc_perl_pppoe] returns reject
> >> Finished request 1.
> >> Cleaning up request 1 ID 9 with timestamp +8
> >> Going to the next request
> >> Waking up in 4.9 seconds.
> >> rad_recv: Accounting-Request packet from host 93.95.41.141 port 57551,
> >> id=9,
> >> length=157
> >> Service-Type = Framed-User
> >> Framed-Protocol = PPP
> >> NAS-Port = 100
> >> NAS-Port-Type = Ethernet
> >> User-Name = "pppoe_test"
> >> Calling-Station-Id = "00:13:77:60:60:CB"
> >> Called-Station-Id = "internet"
> >> NAS-Port-Id = "e2_v15"
> >> Class = 0x6469616c7570
> >> Acct-Session-Id = "8170005c"
> >> Framed-IP-Address = 93.95.42.63
> >> Acct-Authentic = RADIUS
> >> Event-Timestamp = "Apr 7 2009 17:07:22 MSD"
> >> Acct-Status-Type = Start
> >> NAS-Identifier = "ntk-hsgw"
> >> NAS-IP-Address = 93.95.41.141
> >> Acct-Delay-Time = 4
> >> +- entering group preacct {...}
> >> ++[preprocess] returns ok
> >> [acct_unique] Hashing 'NAS-Port = 100,Client-IP-Address =
> >> 93.95.41.141,NAS-IP-Address = 93.95.41.141,Acct-Session-Id =
> >> "8170005c",User-Name = "pppoe_test"'
> >> [acct_unique] Acct-Unique-Session-ID = "de65ab6044a69020".
> >> ++[acct_unique] returns ok
> >> [files] acct_users: Matched entry DEFAULT at line 29
> >> ++[files] returns ok
> >> Found Acct-Type PPPOE_ACC
> >> +- entering group PPPOE_ACC {...}
> >> rlm_perl: perl_embed:: module = /var/www/radius/radius_accounting.pl ,
> >> func
> >> = accounting exit status= Undefined subroutine &main::accounting called.
> >> Segmentation fault
> >>
> >>
> >> But accounting exist in /var/www/radius/radius_accounting.pl. Why it?
> >>
> >>
> >>
> >> Formula+ LTD,
> >> т.(8617) 61-02-01
> >> ф.(8617) 61-34-16
> >> м.(918) 634-7550
> >> voloshin at maks.net
> >> www.formulaplus.ru
> >>
> >> -
> >> List info/subscribe/unsubscribe? See
> >> http://www.freeradius.org/list/users.html
> >
> > -
> > List info/subscribe/unsubscribe? See
> > http://www.freeradius.org/list/users.html
>
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
--
Anatoly S. Zimin
VimpelCom Group, Moscow, Russia
E-Mail: anatolyz at team.co.ru, zimin_as at office.beeline.ru
Phone: +7 [495] 2587800, ext. 56820
More information about the Freeradius-Users
mailing list