首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法链接到模块'rlm_python':rlm_python.so

无法链接到模块'rlm_python':rlm_python.so
EN

Stack Overflow用户
提问于 2017-07-28 18:49:29
回答 1查看 1.6K关注 0票数 1

我试图为freeradius 3.0.8创建一个python身份验证。我跟踪了this example。但是当我试图在调试模式下使用radiusd -X命令启动freeradius时,它显示了以下错误。

代码语言:javascript
复制
/usr/local/etc/raddb/mods-enabled/python[9]: Failed to link to module 'rlm_python': rlm_python.so: cannot open shared object file: No such file or directory

我查看了/usr/local/lib/文件夹,发现rlm_python模块不在那里。如何添加该模块?我在/raddb/mods-available/中的python模块如下所示。

代码语言:javascript
复制
  python {
  module = example

  mod_authorize = ${.module}
  func_authorize = authorize
}

感谢任何人的帮助。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-07-28 22:13:21

根据发行版的不同,rlm_python并不总是打包。

基本的构建说明可以在这里找到:http://wiki.freeradius.org/building/Home

您还需要在系统上安装python-dev/python-devel包。如果python仍然不起作用,您可能需要手动指定python二进制文件的路径,方法是将其传递给configure,例如./configure --with-rlm-python-bin=/usr/bin/python2.7

如果您只是想验证配置脚本是否选择了python cd src/modules/rlm_python; ./configure

在我的系统(macOS 10.11.6)上,找到python时的输出是:

代码语言:javascript
复制
checking for gcc... /usr/local/opt/llvm/bin/clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /usr/local/opt/llvm/bin/clang accepts -g... yes
checking for /usr/local/opt/llvm/bin/clang option to accept ISO C89... none needed
checking how to run the C preprocessor... /usr/local/opt/llvm/bin/clang -E
checking for python2.7... python2.7
configure: Python sys.prefix "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7"
configure: Python sys.exec_prefix "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7"
configure: Python sys.version "2.7"
configure: Python local_mod_libs ""
configure: Python base_mod_libs ""
configure: Python other_libs "-u _PyMac_Error $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK) -ldl -framework CoreFoundation"
checking for Python.h in /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/include/python2.7/... yes
checking for Py_Initialize in -lpython2.7 in /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config... yes
configure: creating ./config.status
config.status: creating all.mk

一旦配置脚本找到了python二进制文件,它通常都会“正常工作”,因为它可以从python本身获得编译和链接标志。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45371531

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档