|
|
6f9931 |
Adjust the mysql-log-rotate script in several ways:
|
|
|
6f9931 |
|
|
|
6f9931 |
* Use the correct log file pathname for Red Hat installations.
|
|
|
6f9931 |
* Enable creation of the log file by logrotate (needed since
|
|
|
6f9931 |
/var/log/ isn't writable by mysql user); and set the same 640
|
|
|
6f9931 |
permissions we normally use.
|
|
|
6f9931 |
* Comment out the actual rotation commands, so that user must edit
|
|
|
6f9931 |
the file to enable rotation. This is unfortunate, but the fact
|
|
|
6f9931 |
that the script will probably fail without manual configuration
|
|
|
6f9931 |
(to set a root password) means that we can't really have it turned
|
|
|
6f9931 |
on by default. Fortunately, in most configurations the log file
|
|
|
6f9931 |
is low-volume and so rotation is not critical functionality.
|
|
|
6f9931 |
|
|
|
6f9931 |
See discussions at RH bugs 799735, 547007
|
|
|
6f9931 |
|
|
|
6f9931 |
|
|
|
6f9931 |
diff -Naur mysql-5.5.22.orig/support-files/mysql-log-rotate.sh mysql-5.5.22/support-files/mysql-log-rotate.sh
|
|
|
6f9931 |
--- mysql-5.5.22.orig/support-files/mysql-log-rotate.sh 2012-03-02 14:44:46.000000000 -0500
|
|
|
6f9931 |
+++ mysql-5.5.22/support-files/mysql-log-rotate.sh 2012-03-23 22:33:29.092043705 -0400
|
|
|
6f9931 |
@@ -3,7 +3,7 @@
|
|
|
6f9931 |
# in the [safe_mysqld] section as follows:
|
|
|
6f9931 |
#
|
|
|
6f9931 |
# [safe_mysqld]
|
|
|
6f9931 |
-# err-log=@localstatedir@/mysqld.log
|
|
|
6f9931 |
+# err-log=/var/log/mysqld.log
|
|
|
6f9931 |
#
|
|
|
6f9931 |
# If the root user has a password you have to create a
|
|
|
6f9931 |
# /root/.my.cnf configuration file with the following
|
|
|
6f9931 |
@@ -18,19 +18,21 @@
|
|
|
6f9931 |
# ATTENTION: This /root/.my.cnf should be readable ONLY
|
|
|
6f9931 |
# for root !
|
|
|
6f9931 |
|
|
|
6f9931 |
-@localstatedir@/mysqld.log {
|
|
|
6f9931 |
- # create 600 mysql mysql
|
|
|
6f9931 |
- notifempty
|
|
|
6f9931 |
- daily
|
|
|
6f9931 |
- rotate 3
|
|
|
6f9931 |
- missingok
|
|
|
6f9931 |
- compress
|
|
|
6f9931 |
- postrotate
|
|
|
6f9931 |
- # just if mysqld is really running
|
|
|
6f9931 |
- if test -x @bindir@/mysqladmin && \
|
|
|
6f9931 |
- @bindir@/mysqladmin ping &>/dev/null
|
|
|
6f9931 |
- then
|
|
|
6f9931 |
- @bindir@/mysqladmin flush-logs
|
|
|
6f9931 |
- fi
|
|
|
6f9931 |
- endscript
|
|
|
6f9931 |
-}
|
|
|
6f9931 |
+# Then, un-comment the following lines to enable rotation of mysql's log file:
|
|
|
6f9931 |
+
|
|
|
6f9931 |
+#/var/log/mysqld.log {
|
|
|
6f9931 |
+# create 640 mysql mysql
|
|
|
6f9931 |
+# notifempty
|
|
|
6f9931 |
+# daily
|
|
|
6f9931 |
+# rotate 3
|
|
|
6f9931 |
+# missingok
|
|
|
6f9931 |
+# compress
|
|
|
6f9931 |
+# postrotate
|
|
|
6f9931 |
+# # just if mysqld is really running
|
|
|
6f9931 |
+# if test -x @bindir@/mysqladmin && \
|
|
|
6f9931 |
+# @bindir@/mysqladmin ping &>/dev/null
|
|
|
6f9931 |
+# then
|
|
|
6f9931 |
+# @bindir@/mysqladmin flush-logs
|
|
|
6f9931 |
+# fi
|
|
|
6f9931 |
+# endscript
|
|
|
6f9931 |
+#}
|