Blame SOURCES/mariadb-logrotate.patch

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