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