rlm_sql_unixodbc: Driver Link failure when running radiusd -X

Clive Allen cliveallen0907 at gmx.com
Thu Nov 25 15:50:39 CET 2021


   Hello all,

   Firstly, my apologies if this is not freeradius related but am hoping
   someone may have seen this before or could point me in the right
   direction please:

   I am trying to connect to an mssql database with freeradius on redhat.

   When running radiusd -X I am getting the following readout (error):

   Nov 25 13:40:27 rhmssql1 radiusd[7698]: Creating attribute Unix-Group
   Nov 25 13:40:27 rhmssql1 radiusd[7698]: Could not link driver
   rlm_sql_unixodbc: /usr/lib64/freeradius/rlm_sql_unixodbc.so: cannot
   open shared object file: No such file or directory
   Nov 25 13:40:27 rhmssql1 radiusd[7698]: Make sure it (and all its
   dependent libraries!) are in the search path of your system's
   Nov 25 13:40:27 rhmssql1 radiusd[7698]:
   /etc/raddb/mods-enabled/sql[27]: Instantiation failed for module "sql"
   Nov 25 13:40:27 rhmssql1 systemd[1]: radiusd.service: control process
   exited, code=exited status=1
   Nov 25 13:40:27 rhmssql1 systemd[1]: Failed to start FreeRADIUS
   multi-protocol policy server.
   -- Subject: Unit radiusd.service has failed

   I have checked the directory /usr/lib64/freeradius/ and sure enough the
   file rlm_sql_unixodbc.so does not exist there.

   I have tested with isql -v rhmssql1 radius radPass_123 and that works
   fine. I can also access the DB with either radius or SA.

   I have configured /etc/odbc.ini with the following:

   [rhmssql1]
   Driver = ODBC Driver 17 for SQL Server
   Description=My DSN for the FreeRADIUS Database
   Database = radius
   Server = tcp:192.168.56.167,1433

   The Driver section in here should then point to the relevant part in
   odbcinst.ini which is configured as follows:

   [ODBC Driver 13 for SQL Server]
   Description=Microsoft ODBC Driver 13 for SQL Server
   Driver=/opt/microsoft/msodbcsql/lib64/libmsodbcsql-13.1.so.9.2
   UsageCount=1

   [ODBC Driver 17 for SQL Server]
   Description=Microsoft ODBC Driver 17 for SQL Server
   Driver=/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.8.so.1.2
   UsageCount=1

   I have checked the locations as follows:

   [root at rhmssql1 lib64]# ldd
   /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.8.so.1.2
           linux-vdso.so.1 =>  (0x00007ffd793f3000)
           libdl.so.2 => /lib64/libdl.so.2 (0x00007fc7c12fa000)
           librt.so.1 => /lib64/librt.so.1 (0x00007fc7c10f2000)
           libodbcinst.so.2 => /lib64/libodbcinst.so.2
   (0x00007fc7c0ed8000)
           libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007fc7c0bef000)
           libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2
   (0x00007fc7c09a2000)
           libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fc7c069a000)
           libm.so.6 => /lib64/libm.so.6 (0x00007fc7c0398000)
           libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fc7c0182000)
           libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fc7bff66000)
           libc.so.6 => /lib64/libc.so.6 (0x00007fc7bfb98000)
           /lib64/ld-linux-x86-64.so.2 (0x00007fc7c190a000)
           libk5crypto.so.3 => /lib64/libk5crypto.so.3
   (0x00007fc7bf965000)
           libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007fc7bf761000)
           libkrb5support.so.0 => /lib64/libkrb5support.so.0
   (0x00007fc7bf551000)
           libkeyutils.so.1 => /lib64/libkeyutils.so.1
   (0x00007fc7bf34d000)
           libresolv.so.2 => /lib64/libresolv.so.2 (0x00007fc7bf133000)
           libselinux.so.1 => /lib64/libselinux.so.1 (0x00007fc7bef0c000)
           libpcre.so.1 => /lib64/libpcre.so.1 (0x00007fc7becaa000)

   I have ensured that the link is correct with:

   [root at rhmssql1 lib64]# odbcinst -q -d -n "ODBC Driver 17 for SQL
   Server"
   [ODBC Driver 17 for SQL Server]
   Description=Microsoft ODBC Driver 17 for SQL Server
   Driver=/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.8.so.1.2
   UsageCount=1

   I have also followed the excellent process doument at
   https://wiki.freeradius.org/modules/Rlm_sql_unixodbc and everything
   works as should except the very last stage (start up of freeradius).
   Excuse my picking up on this as it is a typo I expect - but in there
   you have labelled port "1443" under the DSN (Section 4:Server =
   tcp:192.0.2.1, 1443 and suspect you meant 1433).

   In the /etc/raddb/mods-available - I completed the following changes:
   sql {
         dialect = "mssql"
         driver = "rlm_sql_unixodbc"
   #    driver = "rlm_sql_${dialect}"
   #    Connection info:
   #
           server = "rhmssql1"
           port = 1433
           login = "radius"
           password = "radPass_123"

   Again, many apologies if the answer to this is obvious (which I know it
   is from the error) but this e-mail has been a last resort. There are
   articles on the wiki but they are from 2007 and 2008.

   I have completed a "find" for the named file and cannot find it "find /
   -name "*rlm_sql*"

   Thank you for any pointers.


More information about the Freeradius-Users mailing list