Building freeradius against mariadb client library
We deploy freeradius with our application for a on premise joint solution. We build freeradius from source and include the source and binaries in a installation package. We use rlm_perl and rlm_sql modules With all the issues with Redhat (IBM) we are presently trying to build a new release for Debian 12. It doesn't appear (we could be completely wrong here) that the mysql client libraries are available. I do see mention of them online in a package named default-libmysqlclient-dev but a package search using dpkg-query reveals nothing by that name. I either need the appropriate packages for Debian, or I need to alter the build to use the mariadb library and includes. Perhaps modifying configure.ac to use mariadb_config? What is the solution here?
On 20/07/2023 22:38, Bill Schoolfield wrote:
It doesn't appear (we could be completely wrong here) that the mysql client libraries are available. I do see mention of them online in a package named default-libmysqlclient-dev but a package search using dpkg-query reveals nothing by that name.
# apt-cache search libmysqlclient default-libmysqlclient-dev - MySQL database development files (metapackage) dpkg-query won't query the repos, so you'll only see things that are already installed.
I either need the appropriate packages for Debian, or I need to alter the build to use the mariadb library and includes. Perhaps modifying configure.ac to use mariadb_config?
What is the solution here?
$ make deb or the simplest is to just use the packages we provide from Network RADIUS: https://packages.networkradius.com/ -- Matthew
On 7/20/2023 5:05 PM, Matthew Newton via Freeradius-Users wrote:
On 20/07/2023 22:38, Bill Schoolfield wrote:
It doesn't appear (we could be completely wrong here) that the mysql client libraries are available. I do see mention of them online in a package named default-libmysqlclient-dev but a package search using dpkg-query reveals nothing by that name.
# apt-cache search libmysqlclient default-libmysqlclient-dev - MySQL database development files (metapackage)
dpkg-query won't query the repos, so you'll only see things that are already installed.
Thanks I was using these command interchangeably. Debian is new to me and it seems there are many commands for getting info on packages.
I either need the appropriate packages for Debian, or I need to alter the build to use the mariadb library and includes. Perhaps modifying configure.ac to use mariadb_config?
What is the solution here?
$ make deb
What does this link against? Ideally I'd like mariadb clients and the mariadb server on this host only.
or the simplest is to just use the packages we provide from Network RADIUS:
Considering this. The reason for building was we were a CentOS shop and the packaged FreeRadius was very old. We also (at the time) had our own module (written in C). That module has since been retired. Bill
On 20/07/2023 23:21, Bill Schoolfield wrote:
On 7/20/2023 5:05 PM, Matthew Newton via Freeradius-Users wrote:
dpkg-query won't query the repos, so you'll only see things that are already installed.
Thanks I was using these command interchangeably. Debian is new to me and it seems there are many commands for getting info on packages.
Understood... I've been using Debian ~25 years and I don't think I've ever used dpkg-query before. Generally you should stick to the 'apt' commands and ignore 'dpkg' until you know what you're doing.
I either need the appropriate packages for Debian, or I need to alter the build to use the mariadb library and includes. Perhaps modifying configure.ac to use mariadb_config?
What is the solution here?
$ make deb
What does this link against? Ideally I'd like mariadb clients and the mariadb server on this host only.
Whatever libraries are installed on the system and satisfy the package build dependencies (see debian/control.in). I don't think mysql is even available on Debian 12, so you're safe. If you really want to check then e.g. spin up a Docker instance and build it in there, then the build output will show what's being installed.
or the simplest is to just use the packages we provide from Network RADIUS:
Considering this. The reason for building was we were a CentOS shop and the packaged FreeRadius was very old. We also (at the time) had our own module (written in C). That module has since been retired.
The main reason why we provide packages is because distros don't historically provide very recent FreeRADIUS packages, though the situation is a bit better these days. If you've got no custom modules and want the latest packages, then the NR packages we build should be fine - we build them on every new FR release. (There are packages for CentOS/RHEL/Rocky etc as well which are also up-to-date, but I fully support your move to Debian :) ) -- Matthew
On 7/21/2023 8:04 AM, Matthew Newton via Freeradius-Users wrote:
On 20/07/2023 23:21, Bill Schoolfield wrote:
On 7/20/2023 5:05 PM, Matthew Newton via Freeradius-Users wrote:
dpkg-query won't query the repos, so you'll only see things that are already installed.
Thanks I was using these command interchangeably. Debian is new to me and it seems there are many commands for getting info on packages.
Understood... I've been using Debian ~25 years and I don't think I've ever used dpkg-query before. Generally you should stick to the 'apt' commands and ignore 'dpkg' until you know what you're doing.
I either need the appropriate packages for Debian, or I need to alter the build to use the mariadb library and includes. Perhaps modifying configure.ac to use mariadb_config?
What is the solution here?
$ make deb
What does this link against? Ideally I'd like mariadb clients and the mariadb server on this host only.
Whatever libraries are installed on the system and satisfy the package build dependencies (see debian/control.in). I don't think mysql is even available on Debian 12, so you're safe. If you really want to check then e.g. spin up a Docker instance and build it in there, then the build output will show what's being installed.
control.in requires: default-libmysqlclient-dev | libmysqlclient-dev I did install default-libmysqlclient-dev and freeradius built w/o error and rlm_sql is working. So I now have mysql and mariadb client libraries on this host. Our clients (apps) use the latter, freeradius uses the former to "talk" to a mariadb server. While I'm sure there are some differences these should be interchangeable. Seems unnecessary or maybe even ugly to have both though. While working this I realized we have the same situation with our perl scripts elsewhere that use DBI /DBD. They presently use mysql as well. Bill
or the simplest is to just use the packages we provide from Network RADIUS:
Considering this. The reason for building was we were a CentOS shop and the packaged FreeRadius was very old. We also (at the time) had our own module (written in C). That module has since been retired.
The main reason why we provide packages is because distros don't historically provide very recent FreeRADIUS packages, though the situation is a bit better these days. If you've got no custom modules and want the latest packages, then the NR packages we build should be fine - we build them on every new FR release.
(There are packages for CentOS/RHEL/Rocky etc as well which are also up-to-date, but I fully support your move to Debian :) )
On 21/07/2023 16:25, Bill Schoolfield wrote:
control.in requires: default-libmysqlclient-dev | libmysqlclient-dev
I did install default-libmysqlclient-dev and freeradius built w/o error and rlm_sql is working.
On Debian12, default-libmysqlclient-dev is a metapackage, it contains no files (except a changelog) and depends on libmariadb-dev-compat. libmariadb-dev-compat depends on libmariadb-dev. The only significant "files" it contains are symlinks from the mysql library filenames to their mariadb counterparts.
So I now have mysql and mariadb client libraries on this host. Our clients (apps) use the latter, freeradius uses the former to "talk" to a mariadb server. While I'm sure there are some differences these should be interchangeable. Seems unnecessary or maybe even ugly to have both though.
They're all the same files just symlinked, so there's no possibility of any conflicts.
While working this I realized we have the same situation with our perl scripts elsewhere that use DBI /DBD. They presently use mysql as well.
As I said before, I'm pretty sure Debian 12 doesn't have mysql at all. It's all mariadb, but with compatibility names as everyone's called it mysql for ever. In fact, yes: root@55172a6329fe:/# apt-cache search mysql-server mariadb-server - MariaDB database server binaries mariadb-server-core - MariaDB database core server files default-mysql-server - MySQL database server binaries and system database setup (metapackage) default-mysql-server-core - MySQL database server binaries (metapackage) I don't think you need to worry about anything. Using the packages we build will save you from having to build anything, too, if you wanted. -- Matthew
Thanks, I have a lot to learn. Yes, this is perfect. Bill On 7/21/2023 10:38 AM, Matthew Newton via Freeradius-Users wrote:
On 21/07/2023 16:25, Bill Schoolfield wrote:
control.in requires: default-libmysqlclient-dev | libmysqlclient-dev
I did install default-libmysqlclient-dev and freeradius built w/o error and rlm_sql is working.
On Debian12, default-libmysqlclient-dev is a metapackage, it contains no files (except a changelog) and depends on libmariadb-dev-compat.
libmariadb-dev-compat depends on libmariadb-dev. The only significant "files" it contains are symlinks from the mysql library filenames to their mariadb counterparts.
So I now have mysql and mariadb client libraries on this host. Our clients (apps) use the latter, freeradius uses the former to "talk" to a mariadb server. While I'm sure there are some differences these should be interchangeable. Seems unnecessary or maybe even ugly to have both though.
They're all the same files just symlinked, so there's no possibility of any conflicts.
While working this I realized we have the same situation with our perl scripts elsewhere that use DBI /DBD. They presently use mysql as well.
As I said before, I'm pretty sure Debian 12 doesn't have mysql at all. It's all mariadb, but with compatibility names as everyone's called it mysql for ever.
In fact, yes:
root@55172a6329fe:/# apt-cache search mysql-server mariadb-server - MariaDB database server binaries mariadb-server-core - MariaDB database core server files default-mysql-server - MySQL database server binaries and system database setup (metapackage) default-mysql-server-core - MySQL database server binaries (metapackage)
I don't think you need to worry about anything. Using the packages we build will save you from having to build anything, too, if you wanted.
participants (2)
-
Bill Schoolfield -
Matthew Newton