mysql8.4/mysql-logrotate.patch

66 lines
2.0 KiB
Diff
Raw Normal View History

2012-03-24 05:06:31 +00:00
Adjust the mysql-log-rotate script in several ways:
2012-01-27 05:58:01 +00:00
2012-03-24 05:06:31 +00:00
* 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).
* 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.
2012-01-27 05:58:01 +00:00
2012-03-24 05:06:31 +00:00
See discussions at RH bugs 799735, 547007
diff -Naur mysql-5.5.22.orig/support-files/mysql-log-rotate.sh mysql-5.5.22/support-files/mysql-log-rotate.sh
--- mysql-5.5.22.orig/support-files/mysql-log-rotate.sh 2012-03-02 14:44:46.000000000 -0500
+++ mysql-5.5.22/support-files/mysql-log-rotate.sh 2012-03-23 22:33:29.092043705 -0400
2012-01-27 05:58:01 +00:00
@@ -3,7 +3,7 @@
# in the [safe_mysqld] section as follows:
#
# [safe_mysqld]
-# err-log=@localstatedir@/mysqld.log
+# err-log=/var/log/mysqld.log
#
# If the root user has a password you have to create a
# /root/.my.cnf configuration file with the following
2012-03-24 05:06:31 +00:00
@@ -18,19 +18,21 @@
2012-01-27 05:58:01 +00:00
# ATTENTION: This /root/.my.cnf should be readable ONLY
# for root !
-@localstatedir@/mysqld.log {
2012-03-24 05:06:31 +00:00
- # create 600 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
-}
+# Then, un-comment the following lines to enable rotation of mysql's log file:
+
+#/var/log/mysqld.log {
+# create 600 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
+#}