mysql8.4/community-mysql-logrotate.patch

86 lines
2.7 KiB
Diff
Raw Normal View History

2012-03-24 05:06:31 +00:00
Adjust the mysql-log-rotate script in several ways:
2012-01-27 05:58:01 +00:00
2012-03-24 05:06:31 +00:00
* Use the correct log file pathname for Red Hat installations.
* Enable creation of the log file by logrotate (needed since
2012-06-11 21:25:25 +00:00
/var/log/ isn't writable by mysql user); and set the same 640
permissions we normally use.
2012-03-24 05:06:31 +00:00
* 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.
2012-01-27 05:58:01 +00:00
2012-03-24 05:06:31 +00:00
See discussions at RH bugs 799735, 547007
diff -up mysql-5.6.19/support-files/mysql-log-rotate.sh.logrotate mysql-5.6.19/support-files/mysql-log-rotate.sh
--- mysql-5.6.19/support-files/mysql-log-rotate.sh.logrotate 2014-07-25 11:49:37.237448291 +0200
+++ mysql-5.6.19/support-files/mysql-log-rotate.sh 2014-07-25 11:53:17.096840857 +0200
@@ -1,14 +1,13 @@
-# The log file name and location can be set in
-# /etc/my.cnf by setting the "log-error" option
-# in either [mysqld] or [mysqld_safe] section as
-# follows:
+# This logname can be set in /etc/my.cnf
+# by setting the variable "log-error"
+# in the [mysqld_safe] section as follows:
2012-01-27 05:58:01 +00:00
#
-# [mysqld]
2013-10-09 15:55:08 +00:00
-# log-error=@localstatedir@/mysqld.log
+# [mysqld_safe]
+# log-error=@LOG_LOCATION@
2012-01-27 05:58:01 +00:00
#
-# In case the root user has a password, then you
-# have to create a /root/.my.cnf configuration file
-# with the following content:
+# If the root user has a password you have to create a
+# /root/.my.cnf configuration file with the following
+# content:
#
# [mysqladmin]
# password = <secret>
@@ -16,22 +15,24 @@
#
# where "<secret>" is the password.
#
-# ATTENTION: The /root/.my.cnf file should be readable
-# _ONLY_ by root !
+# ATTENTION: This /root/.my.cnf should be readable ONLY
+# for root !
2012-01-27 05:58:01 +00:00
-@localstatedir@/mysqld.log {
2012-03-24 05:06:31 +00:00
- # create 600 mysql mysql
- notifempty
2013-10-09 15:55:08 +00:00
- daily
- rotate 5
2012-03-24 05:06:31 +00:00
- 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:
+
+#@LOG_LOCATION@ {
2012-06-11 21:25:25 +00:00
+# create 640 mysql mysql
2012-03-24 05:06:31 +00:00
+# notifempty
2013-10-09 15:55:08 +00:00
+# daily
2012-03-24 05:06:31 +00:00
+# 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
+#}