SHA256
1
0
forked from pool/mariadb
mariadb/mysql-logrotate.patch

29 lines
822 B
Diff
Raw Normal View History

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/mysqld.log {
# create 600 mysql mysql
notifempty
daily
@@ -31,6 +31,14 @@
@bindir@/mysqladmin ping &>/dev/null
then
@bindir@/mysqladmin flush-logs
+ ret=$?
+ if test $ret -ne 0
+ then
+ echo "@sysconfdir@/logrotate.d/mysql failed, probably because" >&2
+ echo "the root acount is protected by password." >&2
+ echo "See comments in @sysconfdir@/logrotate.d/mysql on how to fix this" >&2
+ exit $ret
+ fi
fi
endscript
}