我试图为freeradius 3.0.8创建一个python身份验证。我跟着this example。但是,当我尝试使用命令radiusd -X
在调试模式下启动freeradius时,它会显示以下错误。
/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模块如下。
python {
module = example
mod_authorize = ${.module}
func_authorize = authorize
}
感谢任何帮助。
答案 0 :(得分:0)
rlm_python并不总是打包,具体取决于发行版。
基本构建说明可在此处找到:http://wiki.freeradius.org/building/Home
您还需要在系统上安装python-dev / python-devel软件包。如果python仍然无法工作,您可能需要手动指定python二进制文件的路径,方法是将其传递给配置,例如./configure --with-rlm-python-bin=/usr/bin/python2.7
。
如果你只想验证配置脚本已经选择了python cd src/modules/rlm_python; ./configure
在我的系统(macOS 10.11.6)上找到python时的输出是:
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本身获得编译和链接标志。