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