9c7c797
Adjust the mysql-log-rotate script in several ways:
9c7c797
9c7c797
* Use the correct log file pathname for Red Hat installations.
9c7c797
* Enable creation of the log file by logrotate (needed since
9c7c797
  /var/log/ isn't writable by mysql user); and set the same 640
9c7c797
  permissions we normally use.
9c7c797
* Comment out the actual rotation commands, so that user must edit
9c7c797
  the file to enable rotation.  This is unfortunate, but the fact
9c7c797
  that the script will probably fail without manual configuration
9c7c797
  (to set a root password) means that we can't really have it turned
9c7c797
  on by default.  Fortunately, in most configurations the log file
9c7c797
  is low-volume and so rotation is not critical functionality.
9c7c797
9c7c797
See discussions at RH bugs 799735, 547007
9c7c797
9c7c797
Jakub Dorňák 6aba9be
diff -up mariadb-10.0.10/support-files/mysql-log-rotate.sh.p5 mariadb-10.0.10/support-files/mysql-log-rotate.sh
Jakub Dorňák 6aba9be
--- mariadb-10.0.10/support-files/mysql-log-rotate.sh.p5	2014-03-30 19:56:53.000000000 +0200
Jakub Dorňák 6aba9be
+++ mariadb-10.0.10/support-files/mysql-log-rotate.sh	2014-04-07 16:30:11.264618655 +0200
1adc745
@@ -1,9 +1,9 @@
1adc745
 # This logname can be set in /etc/my.cnf
1adc745
-# by setting the variable "err-log"
1adc745
-# in the [safe_mysqld] section as follows:
1adc745
+# by setting the variable "log-error"
1adc745
+# in the [mysqld_safe] section as follows:
9c7c797
 #
1adc745
-# [safe_mysqld]
9c7c797
-# err-log=@localstatedir@/mysqld.log
1adc745
+# [mysqld_safe]
f6b02e3
+# log-error=@LOG_LOCATION@
9c7c797
 #
9c7c797
 # If the root user has a password you have to create a
9c7c797
 # /root/.my.cnf configuration file with the following
9c7c797
@@ -18,19 +18,21 @@
9c7c797
 # ATTENTION: This /root/.my.cnf should be readable ONLY
9c7c797
 # for root !
9c7c797
 
9c7c797
-@localstatedir@/mysqld.log {
9c7c797
-        # create 600 mysql mysql
9c7c797
-        notifempty
9c7c797
-	daily
9c7c797
-        rotate 3
9c7c797
-        missingok
9c7c797
-        compress
9c7c797
-    postrotate
9c7c797
-	# just if mysqld is really running
9c7c797
-	if test -x @bindir@/mysqladmin && \
9c7c797
-	   @bindir@/mysqladmin ping &>/dev/null
9c7c797
-	then
9c7c797
-	   @bindir@/mysqladmin flush-logs
9c7c797
-	fi
9c7c797
-    endscript
9c7c797
-}
9c7c797
+# Then, un-comment the following lines to enable rotation of mysql's log file:
9c7c797
+
f6b02e3
+#@LOG_LOCATION@ {
9c7c797
+#        create 640 mysql mysql
9c7c797
+#        notifempty
9c7c797
+#	daily
9c7c797
+#        rotate 3
9c7c797
+#        missingok
9c7c797
+#        compress
9c7c797
+#    postrotate
9c7c797
+#	# just if mysqld is really running
9c7c797
+#	if test -x @bindir@/mysqladmin && \
9c7c797
+#	   @bindir@/mysqladmin ping &>/dev/null
9c7c797
+#	then
9c7c797
+#	   @bindir@/mysqladmin flush-logs
9c7c797
+#	fi
9c7c797
+#    endscript
9c7c797
+#}