can't find new custom module (shared library object file)
I built a customized version of the rlm_detail module. It was compiled externally against a version of freeradius built from source. The version I'm using is 2.1.12 as this version matches that of the installed YUM package for centos 6.x. On another centos host (same version, 64 bit etc), I installed the packaged version of FR (via yum). Then I copied the rlm_billmax.so to /usr/lib64/freeradius, placed the billmax configure file in the modules directory and added the billmax directive to the default site file (accounting section) and yet freeradius fails to load/find the library file. I have checked the file permissions so that isn't it. What am I missing? Here is the last part of the radiusd -X log:
Wed Nov 6 21:04:26 2013 : Debug: Module: Linked to module rlm_acct_unique Wed Nov 6 21:04:26 2013 : Debug: Module: Instantiating module "acct_unique" from file /etc/raddb/modules/acct_unique Wed Nov 6 21:04:26 2013 : Debug: acct_unique { Wed Nov 6 21:04:26 2013 : Debug: key = "User-Name, Acct-Session-Id, NAS-IP-Address, Client-IP-Address, NAS-Port" Wed Nov 6 21:04:26 2013 : Debug: } Wed Nov 6 21:04:26 2013 : Debug: (Loaded rlm_files, checking if it's valid) Wed Nov 6 21:04:26 2013 : Debug: Module: Linked to module rlm_files Wed Nov 6 21:04:26 2013 : Debug: Module: Instantiating module "files" from file /etc/raddb/modules/files Wed Nov 6 21:04:26 2013 : Debug: files { Wed Nov 6 21:04:26 2013 : Debug: usersfile = "/etc/raddb/users" Wed Nov 6 21:04:26 2013 : Debug: acctusersfile = "/etc/raddb/acct_users" Wed Nov 6 21:04:26 2013 : Debug: preproxy_usersfile = "/etc/raddb/preproxy_users" Wed Nov 6 21:04:26 2013 : Debug: compat = "no" Wed Nov 6 21:04:26 2013 : Debug: } Wed Nov 6 21:04:26 2013 : Debug: Module: Checking accounting {...} for more modules to load Wed Nov 6 21:04:26 2013 : Error: /etc/raddb/modules/billmax[7]: Failed to link to module 'rlm_billmax': file not found Wed Nov 6 21:04:26 2013 : Error: /etc/raddb/sites-enabled/default[384]: Failed to load module "billmax". Wed Nov 6 21:04:26 2013 : Error: /etc/raddb/sites-enabled/default[378]: Errors parsing accounting section.
The file:
[root@ip-10-0-0-65 freeradius]# ls -l /usr/lib64/freeradius/rlm_billmax.so -rwxr-xr-x 1 root root 20193 Nov 6 20:55 /usr/lib64/freeradius/rlm_billmax.so
Bill
Bill Schoolfield wrote:
I built a customized version of the rlm_detail module. It was compiled externally against a version of freeradius built from source. The version I'm using is 2.1.12 as this version matches that of the installed YUM package for centos 6.x.
That sounds like the issue. The process of building from source doesn't always produce the same thing as buildign RPMs. Your best bet would be to add your module to the distribution "tar" file. Then, update the spec file to create an RPM for your module. Finally, do an RPM build which creates the RPMs along with your custom RPM.
On another centos host (same version, 64 bit etc), I installed the packaged version of FR (via yum). Then I copied the rlm_billmax.so to /usr/lib64/freeradius, placed the billmax configure file in the modules directory and added the billmax directive to the default site file (accounting section) and yet freeradius fails to load/find the library file. I have checked the file permissions so that isn't it.
What am I missing?
You're manually reproducing the steps which RPM is supposed to manage. If it works, great. If not, use RPMs. Alan DeKok.
On 11/6/2013 9:13 PM, Alan DeKok wrote:
Bill Schoolfield wrote:
I built a customized version of the rlm_detail module. It was compiled externally against a version of freeradius built from source. The version I'm using is 2.1.12 as this version matches that of the installed YUM package for centos 6.x.
That sounds like the issue. The process of building from source doesn't always produce the same thing as buildign RPMs.
Yea I know, I built the source using, I think, the same or similar configure args and took pains to build the same version as the one in the distro. I really prefer this approach though. The customer installs our rpm and the FR rpm. Then if desired they can run a script to install the needed integration files. Nothing special about loading *.so files. We do it all the time so this must be something simple to fix. I'll poke around the source to see if I can find out why... Bill
Your best bet would be to add your module to the distribution "tar" file. Then, update the spec file to create an RPM for your module. Finally, do an RPM build which creates the RPMs along with your custom RPM.
On another centos host (same version, 64 bit etc), I installed the packaged version of FR (via yum). Then I copied the rlm_billmax.so to /usr/lib64/freeradius, placed the billmax configure file in the modules directory and added the billmax directive to the default site file (accounting section) and yet freeradius fails to load/find the library file. I have checked the file permissions so that isn't it.
What am I missing?
You're manually reproducing the steps which RPM is supposed to manage. If it works, great. If not, use RPMs.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On Thu, Nov 7, 2013 at 10:30 AM, Bill Schoolfield <bill@billmax.com> wrote:
On 11/6/2013 9:13 PM, Alan DeKok wrote:
Bill Schoolfield wrote:
I built a customized version of the rlm_detail module. It was compiled externally against a version of freeradius built from source. The version I'm using is 2.1.12 as this version matches that of the installed YUM package for centos 6.x.
That sounds like the issue. The process of building from source doesn't always produce the same thing as buildign RPMs.
Yea I know, I built the source using, I think, the same or similar configure args and took pains to build the same version as the one in the distro.
I really prefer this approach though. The customer installs our rpm and the FR rpm.
So the custom module is in an RPM? If yes, it should be easier for you to take latest RH's SRPM, then modify the SPEC file to add and compile your module, and then split it as a new package (e.g. freeradius-billmax). Then you distribute only the RPM for your module.
Then if desired they can run a script to install the needed integration files.
Nothing special about loading *.so files. We do it all the time so this must be something simple to fix.
Did you try: - ldd /usr/lib64/freeradius/rlm_billmax.so - verify that all other FR modules are also in the same place (i.e. /usr/lib64/freeradius) ? -- Fajar
On 11/6/2013 10:10 PM, Fajar A. Nugraha wrote:
On Thu, Nov 7, 2013 at 10:30 AM, Bill Schoolfield <bill@billmax.com <mailto:bill@billmax.com>> wrote:
On 11/6/2013 9:13 PM, Alan DeKok wrote:
Bill Schoolfield wrote:
I built a customized version of the rlm_detail module. It was compiled externally against a version of freeradius built from source. The version I'm using is 2.1.12 as this version matches that of the installed YUM package for centos 6.x.
That sounds like the issue. The process of building from source doesn't always produce the same thing as buildign RPMs.
Yea I know, I built the source using, I think, the same or similar configure args and took pains to build the same version as the one in the distro.
I really prefer this approach though. The customer installs our rpm and the FR rpm.
So the custom module is in an RPM?
No. During our build we create the rlm_billmax.so file from the FR files installed from (./configure..., gmake install of the FR tgz) and our library.
If yes, it should be easier for you to take latest RH's SRPM, then modify the SPEC file to add and compile your module, and then split it as a new package (e.g. freeradius-billmax). Then you distribute only the RPM for your module.
This is pretty different from our normal process, so I prefer to see if I can get the other way working first.
Then if desired they can run a script to install the needed integration files.
Nothing special about loading *.so files. We do it all the time so this must be something simple to fix.
Did you try: - ldd /usr/lib64/freeradius/rlm_billmax.so - verify that all other FR modules are also in the same place (i.e. /usr/lib64/freeradius) ?
Yes. The files are all in the same place and ldd doesn't show anything missing.
-- Fajar
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On Thu, Nov 7, 2013 at 12:07 PM, Bill Schoolfield <bill@billmax.com> wrote:
So the custom module is in an RPM?
No. During our build we create the rlm_billmax.so file from the FR files installed from (./configure..., gmake install of the FR tgz) and our library.
Did you try:
- ldd /usr/lib64/freeradius/rlm_billmax.so - verify that all other FR modules are also in the same place (i.e. /usr/lib64/freeradius) ?
Yes. The files are all in the same place and ldd doesn't show anything missing.
Did it work when you install EVERYTHING from the resulting build (i.e. not use FR from rpm)? Just in case it was something simple. -- Fajar
Thanks for your continued help. I went ahead and created a 3 - 4 line program to call dlopen for the shared library. The program worked. Then I looked at the FR source and modified my test pgm to use the same flags in the dlopen call that FR uses... and voila! low and behold it revealed a undefined symbol (from libcurl). Got to call dlerror() to see this. Our library uses libcurl but I forgot to include it (-lcurl) in my Makefile for rlm_billmax.c Rebuilding package now so not sure but I believe I have this resolved. Thanks again for your help. Bill On 11/6/2013 11:15 PM, Fajar A. Nugraha wrote:
On Thu, Nov 7, 2013 at 12:07 PM, Bill Schoolfield <bill@billmax.com <mailto:bill@billmax.com>> wrote:
So the custom module is in an RPM?
No. During our build we create the rlm_billmax.so file from the FR files installed from (./configure..., gmake install of the FR tgz) and our library.
Did you try: - ldd /usr/lib64/freeradius/rlm___billmax.so - verify that all other FR modules are also in the same place (i.e. /usr/lib64/freeradius) ?
Yes. The files are all in the same place and ldd doesn't show anything missing.
Did it work when you install EVERYTHING from the resulting build (i.e. not use FR from rpm)? Just in case it was something simple.
-- Fajar
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Spoke to soon: error (/usr/lib64/freeradius/rlm_billmax.so: undefined symbol: fr_packet_codes) Thoughts anyone? Bill On 11/6/2013 11:15 PM, Fajar A. Nugraha wrote:
On Thu, Nov 7, 2013 at 12:07 PM, Bill Schoolfield <bill@billmax.com <mailto:bill@billmax.com>> wrote:
So the custom module is in an RPM?
No. During our build we create the rlm_billmax.so file from the FR files installed from (./configure..., gmake install of the FR tgz) and our library.
Did you try: - ldd /usr/lib64/freeradius/rlm___billmax.so - verify that all other FR modules are also in the same place (i.e. /usr/lib64/freeradius) ?
Yes. The files are all in the same place and ldd doesn't show anything missing.
Did it work when you install EVERYTHING from the resulting build (i.e. not use FR from rpm)? Just in case it was something simple.
-- Fajar
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On 11/06/2013 09:18 PM, Bill Schoolfield wrote:
I built a customized version of the rlm_detail module. It was compiled externally against a version of freeradius built from source. The version I'm using is 2.1.12 as this version matches that of the installed YUM package for centos 6.x.
On another centos host (same version, 64 bit etc), I installed the packaged version of FR (via yum). Then I copied the rlm_billmax.so to /usr/lib64/freeradius, placed the billmax configure file in the modules directory and added the billmax directive to the default site file (accounting section) and yet freeradius fails to load/find the library file. I have checked the file permissions so that isn't it.
What am I missing?
Make sure you've linked against dependent libraries. After installing the .so make sure you've run ldconfig. -- John
I've given up for now building my module externally. So I added it to the FR source tree and built it that way and it now works. Problem solved. But I have a new problem. We also use rlm_perl. When I reference perl in the site file the rlm_perl.so can't be loaded. I checked; does exist in the lib dir. It appears the build did not create the rlm_perl.so. I checked the modules/rlm_perl dir and it's Makefile has no target defined. Thus nothing was attempted (Make wise). Do I need a configure switch to force the inclusion of rlm_perl? Bill On 11/7/2013 9:05 AM, John Dennis wrote:
On 11/06/2013 09:18 PM, Bill Schoolfield wrote:
I built a customized version of the rlm_detail module. It was compiled externally against a version of freeradius built from source. The version I'm using is 2.1.12 as this version matches that of the installed YUM package for centos 6.x.
On another centos host (same version, 64 bit etc), I installed the packaged version of FR (via yum). Then I copied the rlm_billmax.so to /usr/lib64/freeradius, placed the billmax configure file in the modules directory and added the billmax directive to the default site file (accounting section) and yet freeradius fails to load/find the library file. I have checked the file permissions so that isn't it.
What am I missing?
Make sure you've linked against dependent libraries.
After installing the .so make sure you've run ldconfig.
When you run the configure stage look carefully for the WARNING messages (pipe the output to grep ) . You'll need the perl-devel package installed. -- Sent from my Android device with K-9 Mail. Please excuse my brevity.
On 11/07/2013 01:07 PM, Bill Schoolfield wrote:
I've given up for now building my module externally. So I added it to the FR source tree and built it that way and it now works.
Problem solved. But I have a new problem. We also use rlm_perl. When I reference perl in the site file the rlm_perl.so can't be loaded. I checked; does exist in the lib dir.
It appears the build did not create the rlm_perl.so. I checked the modules/rlm_perl dir and it's Makefile has no target defined. Thus nothing was attempted (Make wise).
Do I need a configure switch to force the inclusion of rlm_perl?
The following wiki page provides instructions for how to build Fedora/RHEL/CentOS RPM. Pay attention to the sections which describe how to ascertain your build requirement and get them installed. http://wiki.freeradius.org/guide/Red-Hat-FAQ -- John
participants (5)
-
Alan Buxey -
Alan DeKok -
Bill Schoolfield -
Fajar A. Nugraha -
John Dennis