mariadb/mariadb-10.2.4-logrotate.patch
2023-05-15 17:33:50 +03:00

35 lines
1.1 KiB
Diff

PATCH-P0-FIX-SUSE: Fix log file path for logrotate
In SUSE we've got MySQL log in different directory. It's located in
/var/log/mysql by default. It also adds some extra error message.
Maintainer: Michal Hrusecky <Michal.Hrusecky@opensuse.org>
diff --git a/support-files/mysql-log-rotate.sh b/support-files/mysql-log-rotate.sh
index c89aa6e0..a8a66ef3 100644
--- a/support-files/mysql-log-rotate.sh
+++ b/support-files/mysql-log-rotate.sh
@@ -18,7 +18,7 @@
# ATTENTION: This /root/.my.cnf should be readable ONLY
# for root !
-@localstatedir@/mysqld.log {
+/var/log/mysql/*.log {
# create 600 mysql mysql
su mysql mysql
notifempty
@@ -33,6 +33,14 @@
then
@bindir@/mysqladmin --local flush-error-log \
flush-engine-log flush-general-log flush-slow-log
+ ret=$?
+ if test $ret -ne 0
+ then
+ echo "/etc/logrotate.d/mariadb failed, probably because" >&2
+ echo "the root acount is protected by password." >&2
+ echo "See comments in /etc/logrotate.d/mariadb on how to fix this" >&2
+ exit $ret
+ fi
fi
endscript
}