mysql8.4/community-mysql-logrotate.patch
2024-02-05 16:59:12 +01:00

67 lines
2.1 KiB
Diff

Adjust the mysql-log-rotate script in several ways:
* Use the correct log file pathname for Red Hat installations.
* Enable creation of the log file by logrotate (needed since
/var/log/ isn't writable by mysql user); and set the same 640
permissions we normally use.
* Comment out the actual rotation commands, so that user must edit
the file to enable rotation. This is unfortunate, but the fact
that the script will probably fail without manual configuration
(to set a root password) means that we can't really have it turned
on by default. Fortunately, in most configurations the log file
is low-volume and so rotation is not critical functionality.
See discussions at RH bugs 799735, 547007
diff -up mysql-5.6.10/support-files/mysql-log-rotate.sh.orig mysql-5.6.10/support-files/mysql-log-rotate.sh
--- mysql-5.6.10/support-files/mysql-log-rotate.sh.orig 2013-01-22 17:54:50.000000000 +0100
+++ mysql-5.6.10/support-files/mysql-log-rotate.sh 2013-02-19 15:27:28.448443077 +0100
@@ -4,7 +4,7 @@
# follows:
#
# [mysqld]
-# log-error=@localstatedir@/mysqld.log
+# log-error=/var/log/mysqld.log
#
# In case the root user has a password, then you
# have to create a /root/.my.cnf configuration file
@@ -19,19 +19,21 @@
# ATTENTION: The /root/.my.cnf file should be readable
# _ONLY_ by root !
-@localstatedir@/mysqld.log {
- # create 600 mysql mysql
- notifempty
- daily
- rotate 5
- 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
- endscript
-}
+# Then, un-comment the following lines to enable rotation of mysql's log file:
+
+#/var/log/mysqld.log {
+# create 640 mysql mysql
+# notifempty
+# daily
+# rotate 3
+# 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
+# endscript
+#}