From 2d6d1bf1c4c6469207e10cfe397e7a5d6ce58de8 Mon Sep 17 00:00:00 2001 From: Lukas Javorsky Date: Thu, 30 Oct 2025 07:56:23 +0000 Subject: [PATCH 1/4] Revert to soft static allocation of MariaDB and MySQL sysusers.d files Resolves: RHEL-119789 Related PR for `setup` RPM: https://src.fedoraproject.org/rpms/setup/pull-request/30 Partially reverts commit: 646e37c The MariaDB and MySQL sysusers.d files has to use soft static allocation in order to correctly handle the MariaDB PAM v2 plugin which utilizes setuid-to-root binary "/usr/lib64/mariadb/plugin/auth_pam_tool_dir/auth_pam_tool". --- mysql8.4.spec | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/mysql8.4.spec b/mysql8.4.spec index 8b28c55..bf1d932 100644 --- a/mysql8.4.spec +++ b/mysql8.4.spec @@ -104,7 +104,7 @@ ExcludeArch: %{ix86} Name: %{majorname}%{majorversion} Version: %{package_version} -Release: 1%{?with_debug:.debug}%{?dist} +Release: 2%{?with_debug:.debug}%{?dist} Summary: MySQL client programs and shared libraries URL: http://www.mysql.com @@ -674,6 +674,13 @@ install -D -p -m 644 %{_vpath_builddir}/scripts/mysql@.service %{buildroot}%{_un install -D -p -m 0644 %{_vpath_builddir}/scripts/mysql.tmpfiles.d %{buildroot}%{_tmpfilesdir}/%{daemon_name}.conf rm -r %{buildroot}%{_tmpfilesdir}/mysql.conf +# Create a sysusers.d config file +# We no longer enforce the hardcoded UID/GID 27 +mkdir -p %{buildroot}%{_sysusersdir} +cat > %{buildroot}%{_sysusersdir}/%{name}.conf << EOF +u mysql 27 'MariaDB and MySQL Server' %{dbdatadir} - +EOF + # helper scripts for service starting install -D -p -m 755 %{_vpath_builddir}/scripts/mysql-prepare-db-dir %{buildroot}%{_libexecdir}/mysql-prepare-db-dir install -p -m 755 %{_vpath_builddir}/scripts/mysql-wait-stop %{buildroot}%{_libexecdir}/mysql-wait-stop @@ -1133,6 +1140,9 @@ popd %endif %changelog +* Tue Feb 24 2026 Lukas Javorsky - 8.4.8-2 +- Revert to soft static allocation of MariaDB and MySQL sysusers.d files + * Fri Jan 23 2026 Michal Schorm - 8.4.8-1 - Rebase to 8.4.8 From bdf88f920bc58bdc9b43ee02209c32882c43a9b9 Mon Sep 17 00:00:00 2001 From: Nikola Davidova Date: Tue, 4 Nov 2025 13:32:39 +0000 Subject: [PATCH 2/4] Extend tmpfiles.d rules for ImageMode After switching to a container image with bootc switch, systemd failed to start mysqld because required runtime directories were missing or had wrong permissions. Adding tmpfiles entries with correct ownership ensures systemd creates the necessary directories at boot and gives them correct permissions, allowing the mysql daemon to start. "In a container build, you can write to '/var'. However, this will have a semantic similar to a Dockerfile VOLUME instruction; the content from the container image is only copied at initial install time. Any subsequent system updates will not by default see new changes. It's recommended instead to use e.g. systemd tmpfiles.d as a way to ensure that newly added state "reconciles" across upgrades as desired." https://docs.fedoraproject.org/en-US/bootc/filesystem/#_filesystem_bind_mount_var This covers all the files in /var sicne we only ship these as can be seen here: find | grep /var/ ./mysql8.4-server-8.4.5-1.fc43.x86_64.rpm/var/lib ./mysql8.4-server-8.4.5-1.fc43.x86_64.rpm/var/lib/mysql ./mysql8.4-server-8.4.5-1.fc43.x86_64.rpm/var/lib/mysql-files ./mysql8.4-server-8.4.5-1.fc43.x86_64.rpm/var/lib/mysql-keyring ./mysql8.4-server-8.4.5-1.fc43.x86_64.rpm/var/log ./mysql8.4-server-8.4.5-1.fc43.x86_64.rpm/var/log/mysql The '/usr' directory is not persistent therefore this change does not affect it and the '/etc' directory is merged in a different way and also not under the 'mysql:mysql' user --- mysql.tmpfiles.d.in | 7 +++++++ mysql8.4.spec | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/mysql.tmpfiles.d.in b/mysql.tmpfiles.d.in index d2c4b31..d22e348 100644 --- a/mysql.tmpfiles.d.in +++ b/mysql.tmpfiles.d.in @@ -1 +1,8 @@ d @PID_FILE_DIR@ 0755 mysql mysql - + +Rules for ephemeral file systems (ImageMode) +/var/lib/mysql 0755 mysql mysql - +/var/log/mysql 0750 mysql mysql - +/var/log/mysql/mysql.log 0640 mysql mysql - +/var/lib/mysql-files 0750 mysql mysql - +/var/lib/mysql-keyring 0700 mysql mysql - diff --git a/mysql8.4.spec b/mysql8.4.spec index bf1d932..8e3c0d5 100644 --- a/mysql8.4.spec +++ b/mysql8.4.spec @@ -1000,11 +1000,15 @@ popd %{_libexecdir}/mysql-scripts-common %{_tmpfilesdir}/%{daemon_name}.conf +%{_sysusersdir}/%{name}.conf + +# Remember to also update the mysql.tmpfiles.d.in file when updating these permissions %attr(0755,mysql,mysql) %dir %{dbdatadir} %attr(0750,mysql,mysql) %dir %{_localstatedir}/lib/mysql-files %attr(0700,mysql,mysql) %dir %{_localstatedir}/lib/mysql-keyring %attr(0755,mysql,mysql) %dir %{pidfiledir} %attr(0750,mysql,mysql) %dir %{logfiledir} + %config(noreplace) %{logrotateddir}/%{daemon_name} %if %{with devel} From 217fb53fc48cea940e068e22fb3981e30e48f1b0 Mon Sep 17 00:00:00 2001 From: Michal Schorm Date: Thu, 20 Nov 2025 14:05:51 +0100 Subject: [PATCH 3/4] [tmpfiles.d] Fixup of the tmpfile.d rules A comment is misisng a comment line prefix --- mysql.tmpfiles.d.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql.tmpfiles.d.in b/mysql.tmpfiles.d.in index d22e348..0471433 100644 --- a/mysql.tmpfiles.d.in +++ b/mysql.tmpfiles.d.in @@ -1,6 +1,6 @@ d @PID_FILE_DIR@ 0755 mysql mysql - -Rules for ephemeral file systems (ImageMode) +# Rules for ephemeral file systems (ImageMode) /var/lib/mysql 0755 mysql mysql - /var/log/mysql 0750 mysql mysql - /var/log/mysql/mysql.log 0640 mysql mysql - From 17687c7d060b556ae947ae9028bb775a7923573e Mon Sep 17 00:00:00 2001 From: Michal Schorm Date: Fri, 21 Nov 2025 07:58:32 +0100 Subject: [PATCH 4/4] [tmpfiles.d] Fixup of the tmpfile.d rules Each line must begin with a valid prefix (type) https://www.man7.org/linux/man-pages/man5/tmpfiles.d.5.html --- mysql.tmpfiles.d.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mysql.tmpfiles.d.in b/mysql.tmpfiles.d.in index 0471433..097295c 100644 --- a/mysql.tmpfiles.d.in +++ b/mysql.tmpfiles.d.in @@ -1,8 +1,8 @@ d @PID_FILE_DIR@ 0755 mysql mysql - # Rules for ephemeral file systems (ImageMode) -/var/lib/mysql 0755 mysql mysql - -/var/log/mysql 0750 mysql mysql - -/var/log/mysql/mysql.log 0640 mysql mysql - -/var/lib/mysql-files 0750 mysql mysql - -/var/lib/mysql-keyring 0700 mysql mysql - +d /var/lib/mysql 0755 mysql mysql - +d /var/log/mysql 0750 mysql mysql - +f /var/log/mysql/mysql.log 0640 mysql mysql - +d /var/lib/mysql-files 0750 mysql mysql - +d /var/lib/mysql-keyring 0700 mysql mysql -