Blame SOURCES/mariadb-logrotate.patch

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