File mariadb-10.2.4-logrotate.patch of Package mariadb
36
1
PATCH-P0-FIX-SUSE: Fix log file path for logrotate
2
3
In SUSE we've got MySQL log in different directory. It's located in
4
/var/log/mysql by default. It also adds some extra error message.
5
6
Maintainer: Michal Hrusecky <Michal.Hrusecky@opensuse.org>
7
8
Index: support-files/mysql-log-rotate.sh
9
===================================================================
10
--- support-files/mysql-log-rotate.sh.orig
11
+++ support-files/mysql-log-rotate.sh
12
13
# ATTENTION: This /root/.my.cnf should be readable ONLY
14
# for root !
15
16
-@localstatedir@/mysqld.log {
17
+/var/log/mysql/mysqld.log {
18
# create 600 mysql mysql
19
notifempty
20
daily
21
22
then
23
@bindir@/mysqladmin --local flush-error-log \
24
flush-engine-log flush-general-log flush-slow-log
25
+ ret=$?
26
+ if test $ret -ne 0
27
+ then
28
+ echo "/etc/logrotate.d/mariadb failed, probably because" >&2
29
+ echo "the root acount is protected by password." >&2
30
+ echo "See comments in /etc/logrotate.d/mariadb on how to fix this" >&2
31
+ exit $ret
32
+ fi
33
fi
34
endscript
35
}
36