From de2e5f37521fff00a91e69a785d3fe731c5b21f5 Mon Sep 17 00:00:00 2001 From: Michal Schorm Date: Thu, 13 Feb 2025 15:04:10 +0000 Subject: [PATCH] Fix patching of logrotate Apply the patch to the correct file, because we use a different one: https://src.fedoraproject.org/rpms/mysql8.0/blob/84d52c8/f/mysql8.0.spec#_663 -- cherry-picked Fedora commit: https://src.fedoraproject.org/rpms/mysql8.0/c/f4c4f1?branch=rawhide -- Resolves: RHEL-79549 --- mysql-flush-logrotate.patch | 52 +++++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 17 deletions(-) diff --git a/mysql-flush-logrotate.patch b/mysql-flush-logrotate.patch index 1e30f6a..48eff40 100644 --- a/mysql-flush-logrotate.patch +++ b/mysql-flush-logrotate.patch @@ -1,17 +1,35 @@ -diff -up mysql-8.0.35/support-files/mysql-log-rotate.in.origf mysql-8.0.35/support-files/mysql-log-rotate.in ---- mysql-8.0.35/support-files/mysql-log-rotate.in.origf 2024-01-29 23:00:32.043257515 +0100 -+++ mysql-8.0.35/support-files/mysql-log-rotate.in 2024-01-29 23:02:26.520440388 +0100 -@@ -49,11 +49,7 @@ - missingok - compress - postrotate -- # just if mysqld is really running -- if test -x @bindir@/mysqladmin && \ -- @bindir@/mysqladmin ping &>/dev/null -- then -- @bindir@/mysqladmin flush-logs -- fi -+ # SIGUSR1 makes the daemon to flush the logs, no need to connect -+ @bindir@/kill -USR1 $(systemctl show --property MainPID --value mysqld) - endscript - } +--- mysql-8.0.40/packaging/rpm-common/mysql.logrotate.in 2024-09-18 12:08:24.000000000 +0200 ++++ mysql-8.0.40/packaging/rpm-common/mysql.logrotate.in_patched 2025-02-13 16:00:32.325677977 +0100 +@@ -5,18 +5,6 @@ + # [mysqld] + # log-error=@LOGFILE_RPM@ + # +-# For the mysqladmin commands below to work, root account +-# password is required. Use mysql_config_editor(1) to store +-# authentication credentials in the encrypted login path file +-# ~/.mylogin.cnf +-# +-# Example usage: +-# +-# mysql_config_editor set --login-path=client --user=root --host=localhost --password +-# +-# When these actions has been done, un-comment the following to +-# enable rotation of mysqld's log error. +-# + + #@LOGFILE_RPM@ { + # create 640 mysql mysql +@@ -26,11 +14,7 @@ + # missingok + # compress + # postrotate +-# # just if mysqld is really running +-# if test -x @bindir@/mysqladmin && \ +-# @bindir@/mysqladmin ping &>/dev/null +-# then +-# @bindir@/mysqladmin flush-logs +-# fi ++# # SIGUSR1 makes the daemon to flush the logs, no need to connect through mysqladmin ++# @bindir@/kill -USR1 $(systemctl show --property MainPID --value mysqld) + # endscript + #}