rlm_python & freeradiusd 2.0.2

Alexander Demidoff demidoff at vpcit.ru
Sat Feb 16 16:10:16 CET 2008


At the end of my attempts to resolve the problem I've found out

1. Compiling options
                --with-experimental-modules \
                --with-rlm_python \
                --with-static-modules=python
2. Befor starting of freeradius I created radiusd_isp.pyc file in the 
interactive python shell

After these conditions my python module began to work with freeradius ...

So, this situation satisfies me for a while. But I am needing help to resolve 
this problem in principle.

best regards,
Alexander.

On Saturday 16 February 2008, Alexander Demidoff wrote:
> Thanks Mike, I expected this suggestion ...
>
> of course, I placed the module into /usr/lib/python2.4/site-packages/
> directory ...
>
> I tried to interact with python:
> # python
> Python 2.4.4 (#2, Jan  3 2008, 13:36:28)
> [GCC 4.2.3 20071123 (prerelease) (Debian 4.2.2-4)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>
> >>> import radiusd_isp
>
> Everything is OK!
>
> but it didn't with freeradius :( ...
>
> On Saturday 16 February 2008, Mike O'Connor wrote:
> > Hi Alexander
> >
> > I think your problem is that python does not know where to find your
> > module.
> >
> > The best way of over coming this issue is to place a file in the
> > site-packages directory which indicates where your python code is
> > installed.
> >
> > [root at rproxy1 site-packages]# cat radiusd_test.pth
> > /opt/freeradius-python/
> > [root at rproxy1 site-packages]#
> >
> > Cheers
> > Mike
> >
> > Alexander Demidoff wrote:
> > > Hello all!
> > > I want to use python possibilities to authorize users with
> > > freeradius.
> > >
> > > So, I compiled freeradius with options:
> > >                 --with-experimental-modules \
> > >                 --with-rlm_python
> > >
> > > created config files and my pythom module  "radiusd_isp",
> > > put it python path
> > >
> > > freeradius -X out me:
> > >
> > >   python {
> > >         mod_instantiate = "radiusd_isp"
> > >         func_instantiate = "instantiate"
> > >         mod_authorize = "radiusd_isp"
> > >         func_authorize = "authorize"
> > >         mod_authenticate = "radiusd_isp"
> > >         func_authenticate = "authenticate"
> > >         mod_preacct = "radiusd_isp"
> > >         func_preacct = "preacct"
> > >         mod_accounting = "radiusd_isp"
> > >         func_accounting = "accounting"
> > >         mod_detach = "radiusd_isp"
> > >         func_detach = "detach"
> > >   }
> > > exceptions.ImportError: No module named radiusd_isp
> > > Failed to import python module "radiusd_isp"
> > > /etc/freeradius/python.conf[32]: Instantiation failed for module
> > > "python" /etc/freeradius/radiusd.conf[1824]: Failed to find module
> > > "python". /etc/freeradius/radiusd.conf[1793]: Errors parsing authorize
> > > section.
> > >
> > > help me anybody, please !?
> > > -
> > > 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





More information about the Freeradius-Users mailing list