Debian 12 and Azure SQL setup issues (trying unixodb/ FreeTDS / iODBC) .
Dear users, After 6 years running Freeradius on CentOS 7 successfully it's time to migrate to Debian12. CentOS7 setup: Freeradius 3, FreeTDS and unixodbc. No setup issues. On my new Debian 12.2 server things seem not that easy. By default, Freeradius is not compiled with unixdbc. Ok, I'm not an advanced user on compile from source but ending up with things like: configure: WARNING: silently not building rlm_sql_unixodbc. configure: WARNING: FAILURE: rlm_sql_unixodbc requires: libodbc sql.h. https://serverfault.com/questions/448365/debian-build-the-freeradius-package... . No solution for Debian 12.unixodbc-(dev) is installed but still... ############################################################## Next try is to use iODBC. Also not working. iodbc modules on debian12 are 12+ years old. Ok compiling from source and issues again; configure.ac:320: error: possibly undefined macro: AM_PATH_GTK If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. make: *** [/usr/share/cdbs/1/class/autotools-files.mk:71: debian/stamp-autotools-files] Error 1 dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2 Got stuck again. ############################################################## Next try is to use FreeTDS module with /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so odbc.ini, odbcinst.ini and FreeTDS.conf configured as it should be. no luck still, freeradius -X always show: rlm_sql (sql): Opening additional connection (0), 1 of 32 pending slots used rlm_sql_freetds: unable to establish db to symbolic servername mydatabasedsn rlm_sql_freetds: client error: severity(0), number(34), origin(0), layer(0): Adaptive Server connection failed rlm_sql_freetds: socket destructor called, closing socket rlm_sql (sql): Opening connection failed (0) rlm_sql (sql): Removing connection pool /etc/freeradius/mods-enabled/sql[27]: Instantiation failed for module "sql" Got stuck again. With isql and tsql i can connect manually, so the server>azure sql link works. No issues with that. Summary of my request: If anyone could provide me some help how to get a working sql connection from Freeradius to azure sql on debian12 would be great, regardless of the connection method. Or it's a missing (for me unknown param in mods-enabled\sql) Thanks, Olaf
On Dec 11, 2023, at 3:43 AM, Olaf <siegson@gmail.com> wrote:
On my new Debian 12.2 server things seem not that easy. By default, Freeradius is not compiled with unixdbc. Ok, I'm not an advanced user on compile from source but ending up with things like:
configure: WARNING: silently not building rlm_sql_unixodbc. configure: WARNING: FAILURE: rlm_sql_unixodbc requires: libodbc sql.h.
If unixodbc is installed, then the configure process should be able to find it. The only magic is finding out where the unixodbc libraries / header files are, and passing that to configure. The simplest way is: $ ./configure --with-unixodbc-include-dir=/path/to/include --with-unixodbc-lib-dir=/path/to/lib ... other args ... It should then work. My guess is that the unixodbc libraries are installed in a non-standard place, so the files aren't found by the C compiler during normal process. So find out where those files are, and pass the directories to configure.
https://serverfault.com/questions/448365/debian-build-the-freeradius-package...
That page is 11 years old. There's a much newer page on the FreeRADIUS wiki, written by one of the FreeRADIUS contributors. But from reading posts to the lists, it seems there's a secret prohibition against reading the official documentation. I have no idea why,
############################################################## Next try is to use iODBC. Also not working. iodbc modules on debian12 are 12+ years old. Ok compiling from source and issues again;
configure.ac:320: error: possibly undefined macro: AM_PATH_GTK If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. make: *** [/usr/share/cdbs/1/class/autotools-files.mk:71:
Uh... what? The string "AM_PATH_GTK" doesn't appear in the FreeRADIUS source code. If you're trying to build some other program, we can't help you. We didn't write that software, and we know nothing about it.
Next try is to use FreeTDS module with /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so odbc.ini, odbcinst.ini and FreeTDS.conf configured as it should be.
no luck still, freeradius -X always show:
rlm_sql (sql): Opening additional connection (0), 1 of 32 pending slots used rlm_sql_freetds: unable to establish db to symbolic servername mydatabasedsn rlm_sql_freetds: client error: severity(0), number(34), origin(0),
FreeRADIUS is unable to connect to the database. Either the database is unavailable, or the configuration parameters are wrong. Unfortunately we don't run freetds here, and we don't know a lot about it. The rlm_sql_freetds driver was contributed a long time ago. It it works, great. If not, it's a hard problem to solve. And please use an official 3.2.x release. You didn't say which version you're trying to build. So if it's an older version, don't bother. Use the most recent release. Alan DeKok.
Allan, So to compile it with unixodbc is the prefered way to go.
If unixodbc is installed, then the configure process should be able to find it. The only magic is finding out where the unixodbc libraries / header files are, and passing that to configure. The simplest way is:
$ ./configure --with-unixodbc-include-dir=/path/to/include --with-unixodbc-lib-dir=/path/to/lib ... other args ...
OK.. will give it another try.
But from reading posts to the lists, it seems there's a secret prohibition against reading the official documentation. I have no idea why,
Yeah, some guidance would be helpful. Thanks Olaf
On Dec 11, 2023, at 9:20 AM, Olaf <siegson@gmail.com> wrote:
But from reading posts to the lists, it seems there's a secret prohibition against reading the official documentation. I have no idea why,
Yeah, some guidance would be helpful.
Go to the Wiki. Look for unixodbc. There is extensive documentation. Alan DeKok.
On 11/12/2023 12:42, Alan DeKok wrote:
Unfortunately we don't run freetds here, and we don't know a lot about it. The rlm_sql_freetds driver was contributed a long time ago. It it works, great. If not, it's a hard problem to solve.
FreeTDS is the best way to go, if you can get it working. It was definitely working with MS SQL server a year or two ago, but no idea about Azure SQL. This is the first time in years that I've heard ODBC mentioned or being used, and I was expecting (hoping?) to never hear about it again... -- Matthew
Ok mixed signals! nice hahah Probably the reason it's not compiled by default anymore with unixodbc Olaf On Mon, Dec 11, 2023 at 3:39 PM Matthew Newton via Freeradius-Users < freeradius-users@lists.freeradius.org> wrote:
FreeTDS is the best way to go, if you can get it working. It was definitely working with MS SQL server a year or two ago, but no idea about Azure SQL.
Finally got it working with FreeTDS . /etc/freetds/freetds.conf was missing the "database = mydb" entry Dohhhh Thank you all, Olaf
participants (3)
-
Alan DeKok -
Matthew Newton -
Olaf