ganapathi / rpms / mariadb

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