mariadb/mariadb-10.2.4-logrotate.patch
Kristyna Streitova a40180b467 Accepting request 676156 from home:tbechtold:branches:server:database
- add slow_query_log example to my.cnf and adjust the logrotate
  configuration to rotate all /var/log/mysql/*.log files .
  This is useful when the slow query log is enabled. In that case,
  this log file should also be rotated (bsc#1112767)

OBS-URL: https://build.opensuse.org/request/show/676156
OBS-URL: https://build.opensuse.org/package/show/server:database/mariadb?expand=0&rev=225
2019-02-15 11:05:43 +00:00

36 lines
1.0 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>
Index: support-files/mysql-log-rotate.sh
===================================================================
--- support-files/mysql-log-rotate.sh.orig
+++ 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
notifempty
daily
@@ -32,6 +32,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
}