Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rhel8: compile icinga2-ido-mysql against mariadb-connector-c #205

Closed
philfry opened this issue Mar 1, 2021 · 3 comments
Closed

rhel8: compile icinga2-ido-mysql against mariadb-connector-c #205

philfry opened this issue Mar 1, 2021 · 3 comments
Assignees

Comments

@philfry
Copy link

philfry commented Mar 1, 2021

Describe the bug

With RHEL 8 and derivates, icinga2 should be compiled against mariadb-connector-c instead of mysql due to a change of the default database.

See Notable changes in MySQL 8.0 in https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/8.0_release_notes/rhel-8_0_0_release#web-servers-databases-dynamic-languages

The new mariadb-connector-c packages provide a common client library for MySQL and MariaDB. This library is usable with any version of the MySQL and MariaDB database servers. As a result, the user is able to connect one build of an application to any of the MySQL and MariaDB servers distributed with RHEL 8.

To Reproduce

$ rpm -qp icinga2-ido-mysql-2.12.3-1.el8.icinga.x86_64.rpm --requires | grep mysqlclient
libmysqlclient.so.21()(64bit)
libmysqlclient.so.21(libmysqlclient_21.0)(64bit)

Expected behavior

$ rpm -qp icinga2-ido-mysql-2.12.3-1.el8.x86_64.rpm --requires | grep mysqlclient
libmariadb.so.3(libmysqlclient_18)(64bit)

Your Environment

Include as many relevant details about the environment you experienced the problem in

  • Version used (icinga2 --version): 2.12.3-1.el8
  • Operating System and version: OL 8.3, RHEL 8.3, CentOS 8 stream
  • Enabled features (icinga2 feature list): n/a
  • Icinga Web 2 version and modules (System - About): n/a
  • Config validation (icinga2 daemon -C): n/a
  • If you run multiple Icinga 2 instances, the zones.conf file (or icinga2 object list --type Endpoint and icinga2 object list --type Zone) from all affected nodes.

Additional context

Proposed patch for the spec file:

diff --git i/icinga2.spec w/icinga2.spec
index d222f65..3e8f8f0 100644
--- i/icinga2.spec
+++ w/icinga2.spec
@@ -259,9 +259,13 @@ BuildRequires:  libmysqlclient-devel
 BuildRequires:  mysql-devel
 %endif
 
+%else
+%if 0%{?rhel} >= 8
+BuildRequires:  mariadb-connector-c-devel
 %else
 BuildRequires:  mysql-devel
 %endif #suse
+%endif
 
 Requires:       %{name}-bin = %{version}-%{release}
 
@@ -651,6 +655,7 @@ getent passwd %{icinga_user} >/dev/null || %{_sbindir}/useradd -c "icinga" -s /s
 %endif
 %endif
 
+%if %{with mysql}
 %post ido-mysql
 if [ ${1:-0} -eq 1 ] && [ -e %{_sysconfdir}/%{name}/features-enabled/ido-mysql.conf ]
 then
@@ -667,7 +672,9 @@ if [ "$1" = "0" ]; then
 fi
 
 exit 0
+%endif
 
+%if %{with pgsql}
 %post ido-pgsql
 if [ ${1:-0} -eq 1 ] && [ -e %{_sysconfdir}/%{name}/features-enabled/ido-pgsql.conf ]
 then
@@ -684,6 +691,7 @@ if [ "$1" = "0" ]; then
 fi
 
 exit 0
+%endif
 
 %if 0%{?use_selinux}
 %post selinux

Notes regarding the patch:

  • used %else\n%if instead of %elif because %elif is supported only in rpm 4.15+
  • added conditionals for the %post sections because otherwise the specfile gets invalid when disabling one of these databases.

See also: Icinga/icinga2#7927

@julianbrost julianbrost transferred this issue from Icinga/icinga2 Mar 2, 2021
@philfry
Copy link
Author

philfry commented Jul 16, 2021

Hi,
any news on this? icinga 2.12.5 has been released and it is still compiled against mysql.

@htriem
Copy link
Contributor

htriem commented Jul 16, 2021

Hey, I've checked this topic out today (likewise with Icinga/icinga2#7927 ), and agree with your examination of the problem.
Done some testing; we will have packages with mariadb-connector-c by Monday.

@htriem
Copy link
Contributor

htriem commented Jul 22, 2021

The newly released revisions, 2.11.10-2 and 2.12.5-2 are now being built against mariadb-connector-c, check them out if you'd like to.
I will go ahead and close this issue. Thanks for participating on Icinga!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants