7a5573f
Adjust the mysql-log-rotate script in several ways:
7a5573f
7a5573f
* Use the correct log file pathname for Red Hat installations.
7a5573f
* Enable creation of the log file by logrotate (needed since
7a5573f
  /var/log/ isn't writable by mysql user); and set the same 640
7a5573f
  permissions we normally use.
7a5573f
* Comment out the actual rotation commands, so that user must edit
7a5573f
  the file to enable rotation.  This is unfortunate, but the fact
7a5573f
  that the script will probably fail without manual configuration
7a5573f
  (to set a root password) means that we can't really have it turned
7a5573f
  on by default.  Fortunately, in most configurations the log file
7a5573f
  is low-volume and so rotation is not critical functionality.
7a5573f
7a5573f
See discussions at RH bugs 799735, 547007
7a5573f
7a5573f
c48a49a
diff -up mysql-5.6.19/support-files/mysql-log-rotate.sh.logrotate mysql-5.6.19/support-files/mysql-log-rotate.sh
c48a49a
--- mysql-5.6.19/support-files/mysql-log-rotate.sh.logrotate	2014-07-25 11:49:37.237448291 +0200
c48a49a
+++ mysql-5.6.19/support-files/mysql-log-rotate.sh	2014-07-25 11:53:17.096840857 +0200
c48a49a
@@ -1,14 +1,13 @@
c48a49a
-# The log file name and location can be set in
c48a49a
-# /etc/my.cnf by setting the "log-error" option
c48a49a
-# in either [mysqld] or [mysqld_safe] section as
c48a49a
-# follows:
c48a49a
+# This logname can be set in /etc/my.cnf
c48a49a
+# by setting the variable "log-error"
c48a49a
+# in the [mysqld_safe] section as follows:
7a5573f
 #
c48a49a
-# [mysqld]
9d8b442
-# log-error=@localstatedir@/mysqld.log
c48a49a
+# [mysqld_safe]
c48a49a
+# log-error=@LOG_LOCATION@
7a5573f
 #
c48a49a
-# In case the root user has a password, then you
c48a49a
-# have to create a /root/.my.cnf configuration file
c48a49a
-# with the following content:
c48a49a
+# If the root user has a password you have to create a
c48a49a
+# /root/.my.cnf configuration file with the following
c48a49a
+# content:
c48a49a
 #
c48a49a
 # [mysqladmin]
c48a49a
 # password = <secret> 
c48a49a
@@ -16,22 +15,24 @@
c48a49a
 #
c48a49a
 # where "<secret>" is the password. 
c48a49a
 #
c48a49a
-# ATTENTION: The /root/.my.cnf file should be readable
c48a49a
-# _ONLY_ by root !
c48a49a
+# ATTENTION: This /root/.my.cnf should be readable ONLY
c48a49a
+# for root !
7a5573f
 
7a5573f
-@localstatedir@/mysqld.log {
7a5573f
-        # create 600 mysql mysql
7a5573f
-        notifempty
9d8b442
-        daily
9d8b442
-        rotate 5
7a5573f
-        missingok
7a5573f
-        compress
7a5573f
-    postrotate
7a5573f
-	# just if mysqld is really running
7a5573f
-	if test -x @bindir@/mysqladmin && \
7a5573f
-	   @bindir@/mysqladmin ping &>/dev/null
7a5573f
-	then
7a5573f
-	   @bindir@/mysqladmin flush-logs
7a5573f
-	fi
7a5573f
-    endscript
7a5573f
-}
7a5573f
+# Then, un-comment the following lines to enable rotation of mysql's log file:
7a5573f
+
c48a49a
+#@LOG_LOCATION@ {
7a5573f
+#        create 640 mysql mysql
7a5573f
+#        notifempty
9d8b442
+#        daily
7a5573f
+#        rotate 3
7a5573f
+#        missingok
7a5573f
+#        compress
7a5573f
+#    postrotate
7a5573f
+#	# just if mysqld is really running
7a5573f
+#	if test -x @bindir@/mysqladmin && \
7a5573f
+#	   @bindir@/mysqladmin ping &>/dev/null
7a5573f
+#	then
7a5573f
+#	   @bindir@/mysqladmin flush-logs
7a5573f
+#	fi
7a5573f
+#    endscript
7a5573f
+#}