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