0

I'm following the steps @freeradius.org to enable python. After the initial round of changes, I start the server and get this amongst the startup chatter:

Failed loading libpython symbols into global symbol table: libpython2.7.so: cannot open shared object file: No such file or directory

However, a check on two machines (my reference and test machines), I find:

/usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.so

Has anyone had and/or solved this? Both servers are Ubuntu 16.04.2 LTS

Hugh Buntu
  • 109
  • 4

1 Answers1

0

Note: I encourage answers that are better than mine!

A look at the freeradius C source code module rlm_python.c shows that the system call dlopen() is called to open libpython2.7.so. If it can't be found, dlerror() is called.

The dlopen() call looks for the file in subdirectories present in the LD_LIBRARY_PATH environmental variable at the time the program is run. My old sysadmin nemesis! LD_LIBRARY_PATH is supposed to contain a colon separated list of directories that dlopen() can rummage through in hopes of locating a matching library file. None of the Ubuntu machines I looked at, including the one in question, had set this variable! A time-bomb waiting to go off when an app that wants to access a variety of libraries is run, considering that there are standard places for such files (that vary by distro).

Setting the variable before starting the server solved the problem. When freeradius needs to be loaded at boot time, you'll need to pick a strategy to do this. When starting the server in debug mode, you can simply do this:

# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/python2.7/config-x86_64-linux-gnu
# freeradius -X

... be sure to substitute the correct directory if it isn't the one shown above.

Hugh Buntu
  • 109
  • 4