8

We've got a FreeRADIUS 2 deamon installed on a CentOS 5.7 server.

We'd like to use a pre-written Python module to do authorization but there's a problem: The Python module we've got requires Python 2.6 or more but the Python that comes installed with CentOS is Python 2.4.

Now, the server admin have installed Python 2.6 in a separate folder /usr/lib/Python2.6 so we can run Python 2.6 from there. However, /usr/bin/python is still Python 2.4. Apparently, replacing the default Python 2.4 will cause all kinds of problems.

Is there any way I can force FreeRADIUS to use /usr/lib/Python2.6 instead of the default 2.4 to locate and run modules?

chicks
  • 3,639
  • 10
  • 26
  • 36
henriksen
  • 273
  • 2
  • 7
  • Can't the script be modified to run from a specific path? – Bart Silverstrim Jan 23 '12 at 14:01
  • I think you try to export PATH variable in freeradius startup script. In the exported value, you can specify `/usr/lib/` as first path and then append the default other paths like `/bin` and `/usr/bin`. You may need also to symlink python2.6 to python. – Khaled Jan 23 '12 at 14:15
  • Symlinking Python won't work since that'll break stuff for CentOS. Specifying the path in the script, didn't try that. Will check. – henriksen Jan 23 '12 at 17:49

2 Answers2

1

Open up the init script (something like /etc/init.d/freeradius). You then need to locate the line where it's launching the application, and change any instance of python to /usr/lib/Python2.6.

chicks
  • 3,639
  • 10
  • 26
  • 36
devicenull
  • 5,572
  • 1
  • 25
  • 31
0

You should be able to call the 2.6 Python directly by listing the full path. So, if your script was called FreeRADIUS.py, your script would read /usr/lib/Python2.6/FreeRADIUS.py.

Simon Hova
  • 248
  • 1
  • 4