Building against MariaDB 10.5

Sebastian Hagedorn Hagedorn at uni-koeln.de
Wed May 26 17:06:47 CEST 2021


On 26 May 2021, at 16:47, Alan DeKok wrote:

> On May 26, 2021, at 10:30 AM, Sebastian Hagedorn <Hagedorn at uni-koeln.de> wrote:
> We run freeradius on RHEL 7, using our own RPMs that are based on the SPEC file included with freeradius, but with some differences. Our database team doesn’t want to use the stock mariadb RPM, so we use version 10.5 from http://yum.mariadb.org/10.5/rhel7-amd64.
>
> The issue is that I have found that when I build the freeradius 3.0.22 RPM with MariaDB 10.5 installed, the freeradius server doesn’t run properly. I configured a panic_action and can provide the gdb files if there is interest.
> If I use mariadb-devel 5.5 (standard issue RHEL 7) to build, everything works fine, even when the database server is running MariaDB 10.5. So there is a workaround, but I wonder if it shouldn’t be possible to compile with the newer version installed?
>
>   You're building FreeRADIUS against one version of the MariaDB client libraries.  Then at run time, linking it to a different version of the MariaDB client libraries.

And yet, that is the only way to make it work. Perhaps I wasn’t clear. When I build using 10.5 libraries and headers, *and* run using the same libraries, it does *not* work. I forgot to mention that the MariaDB-devel RPM from 10.5 isn’t sufficient. With only that installed, rlm_sql_mysql is skipped because the configure script fails to find the library to link to:

checking for mysql_config... yes
checking for mysql_init in -lmysqlclient_r (using mysql_config)... no
checking for mysql_init in -lmysqlclient (using mysql_config)... no
checking for mysql_init in -lmysqlclient_r in /usr/lib... no
checking for mysql_init in -lmysqlclient_r in /usr/lib/mysql... no
checking for mysql_init in -lmysqlclient_r in /usr/local/lib/mysql... no
checking for mysql_init in -lmysqlclient_r in /usr/local/mysql/lib/mysql... no
checking for mysql_init in -lmysqlclient_r... no
checking for mysql_init in -lmysqlclient_r in /usr/local/lib... no
checking for mysql_init in -lmysqlclient_r in /opt/lib... no

I had to install MariaDB-shared as well, which appears to be a compatibility layer.

I noticed the following warning when compiling with that configuration:

CC src/modules/rlm_sql/drivers/rlm_sql_mysql/rlm_sql_mysql.c
In file included from src/modules/rlm_sql/drivers/rlm_sql_mysql/rlm_sql_mysql.c:42:0:
/usr/include/mysql/mysql_version.h:3:2: warning: #warning This file should not be included by clients, include only <mysql.h> [-Wcpp]
 #warning This file should not be included by clients, include only <mysql.h>
  ^
cc1: warning: unrecognized command line option "-Wno-date-time" [enabled by default]
LINK build/lib/rlm_sql_mysql.la

>   Mixing and matching libraries doesn't usually work well.
>
>   You should get the mariadb-devel libraries and headers from the same location that you got the run-time libraries from.
>
>   What's happening is that the internal data structures used by the Mariadb client have one definition on the build system, and then have different definitions	on the production system.  That cause things to go "boom".

Again, the only way I can get it to work is currently to build the RPM on a development server with mariadb-devel 5.5, and to run it on production servers with MariaDB 10.5
-- 
   .:.Sebastian Hagedorn - Weyertal 121 (Gebäude 133), Zimmer 2.02.:.
                .:.Regionales Rechenzentrum (RRZK).:.
  .:.Universität zu Köln / Cologne University - ✆ +49-221-470-89578.:.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4924 bytes
Desc: S/MIME digital signature
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20210526/93a05caf/attachment.bin>


More information about the Freeradius-Users mailing list