Hi. I use freeradius 1.1.0 on Debian 3.1 stable. freeradius is compiled to deb-package by the command "dpkg-buildpackage -rfakeroot -uc -b" and installed by "dpkg -i". I tried to use test perl module 'example.pl'. Here is part of my radiusd.conf: ... modules { ... perl test_module { module = ${confdir}/example.pl } ... } accounting { detail sql test_module } ... And /usr/sbin/freeradius -X says: ... Module: Loaded perl perl: module = "/etc/freeradius/example.pl" perl: func_authorize = "authorize" perl: func_authenticate = "authenticate" perl: func_accounting = "accounting" perl: func_preacct = "preacct" perl: func_checksimul = "checksimul" perl: func_detach = "detach" perl: func_xlat = "xlat" perl: func_pre_proxy = "pre_proxy" perl: func_post_proxy = "post_proxy" perl: func_post_auth = "post_auth" perl: perl_flags = "(null)" perl: func_start_accounting = "(null)" perl: func_stop_accounting = "(null)" rlm_perl: perl_parse failed: /etc/freeradius/example.pl not found or has syntax errors. radiusd.conf[211]: test_module: Module instantiation failed. radiusd.conf[245] Unknown module "test_module". radiusd.conf[242] Failed to parse accounting section. The file exists: # ls -l /etc/freeradius/example.pl -rw-r----- 1 root freerad 4620 Jan 24 14:26 /etc/freeradius/example.pl Perl says that syntax is OK: # perl -c /etc/freeradius/example.pl /etc/freeradius/example.pl syntax OK Where may be the error? If the errors are in the perl module "example.pl", how do I see the extended output? -- Best regards Yevgeny
wazn@sibmail.ru wrote:
rlm_perl: perl_parse failed: /etc/freeradius/example.pl not found or has syntax errors. radiusd.conf[211]: test_module: Module instantiation failed. radiusd.conf[245] Unknown module "test_module". radiusd.conf[242] Failed to parse accounting section.
The file exists: # ls -l /etc/freeradius/example.pl -rw-r----- 1 root freerad 4620 Jan 24 14:26 /etc/freeradius/example.pl
Perl says that syntax is OK: # perl -c /etc/freeradius/example.pl /etc/freeradius/example.pl syntax OK
It is: <*quote*> use Data::Dumper; </*quote*> in "example.pl" that causes the trouble. Quote from: http://www.perl.com/doc/manual/html/pod/perlembed.html#Compiling_your_C_prog... <*quote*> Also, every C program that uses Perl must link in the perl library. What's that, you ask? Perl is itself written in C; the perl library is the collection of compiled C programs that were used to create your perl executable ( /usr/bin/perl or equivalent). (Corollary: you can't use Perl from your C program unless Perl has been compiled on your machine, or installed properly--that's why you shouldn't blithely copy Perl executables from machine to machine without also copying the lib directory.) </*quote*> So if you include: -lperl while compiling radiusd then you get what is needed to dynamically load perl modules. I don't know if this is the right way, but, at least, it works for me. I wonder if this library inclusion could be automated at the configure stage...
Where may be the error? If the errors are in the perl module "example.pl", how do I see the extended output?
An answer to this question would interest me, too! If this is not possible, then which is the simpliest aproach to simulating a "radius wrapper environment" to debug a perl script? -- Nikolaos A. Diamantis /v / /< </ /| <-\ </ > <-\. <| / <-\ /v| <-\ /v 7 /-/ >
It is:
<*quote*> use Data::Dumper; </*quote*>
in "example.pl" that causes the trouble.
Many thanks. I commented this string out and freeradius is running.
I wonder if this library inclusion could be automated at the configure stage...
In my case, it happened automatically by itself.
An answer to this question would interest me, too! If this is not possible, then which is the simpliest aproach to simulating a "radius wrapper environment" to debug a perl script?
If anyone here has something to say about this issue, please share. -- Best regards. Yevgeny
On Monday 06 March 2006 15:24, Nikos Diamantis wrote:
wazn@sibmail.ru wrote:
It is:
<*quote*> use Data::Dumper; </*quote*>
in "example.pl" that causes the trouble.
It seems you don't have a Data::Dumper module. Running your script with "perl example.pl" can show this.
Quote from:
http://www.perl.com/doc/manual/html/pod/perlembed.html#Compiling_your_C_pro gram
<*quote*> Also, every C program that uses Perl must link in the perl library. What's that, you ask? Perl is itself written in C; the perl library is the collection of compiled C programs that were used to create your perl executable ( /usr/bin/perl or equivalent). (Corollary: you can't use Perl from your C program unless Perl has been compiled on your machine, or installed properly--that's why you shouldn't blithely copy Perl executables from machine to machine without also copying the lib directory.) </*quote*>
So if you include:
-lperl
You don't need that. This is done automatically.
while compiling radiusd then you get what is needed to dynamically load perl modules. I don't know if this is the right way, but, at least, it works for me.
This is completly wrong. Read the "Using Perl modules, which themselves use C libraries, from your C program" subsection in perlemebed manual page to understand how this is done.
I wonder if this library inclusion could be automated at the configure stage...
Where may be the error? If the errors are in the perl module "example.pl", how do I see the extended output?
Use command like that perl /path_to_your_program/program.pl it is enough to see if there is some module missing etc. Also perl -c is good to check syntax.
An answer to this question would interest me, too! If this is not possible, then which is the simpliest aproach to simulating a "radius wrapper environment" to debug a perl script?
-- Best Regards, Boian Jordanov SNE Orbitel - Next Generation Telecom tel. +359 2 4004 723 tel. +359 2 4004 002
participants (4)
-
Boian Jordanov -
Nikos Diamantis -
wazn@sibmail.ru -
Yevgeny