-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDEV-22659: Create one single unified and optimal logrotate config
Replace mysql-log-rotate.sh and debian/...mysql-server.logrotate with one new unified and well documented version. Name is mariadb.logrotate.in as in 10.5 branch we use now the 'mariadb' name, and use 'logrotate' to match the actual name of the utlity, and use '.in' instead of '.sh' as this is not a shell script but a template file.
- Loading branch information
Showing
8 changed files
with
74 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# This is the MariaDB configuration for the logrotate utility | ||
# | ||
# Note that on most Linux systems logs are written to journald, which has its | ||
# own rotation scheme. | ||
# | ||
# Read https://mariadb.com/kb/en/error-log/ to learn more about logging and | ||
# https://mariadb.com/kb/en/rotating-logs-on-unix-and-linux/ about rotating logs. | ||
|
||
@localstatedir@/mysqld.log @logdir@/mysql.log @localstatedir@/mariadb.log @logdir@/mysql-slow.log @logdir@/mariadb-slow.log @logdir@/error.log { | ||
|
||
# If any of the files listed above is missing, skip them silently without | ||
# emitting any errors | ||
missingok | ||
|
||
# If file exists but is empty, don't rotate it | ||
notifempty | ||
|
||
# Run monthly | ||
monthly | ||
|
||
# Keep 6 months of logs | ||
rotate 6 | ||
|
||
# If file is growing too big, rotate immediately | ||
maxsize 50M | ||
|
||
# If file size is too small, don't rotate at all | ||
minsize 50M | ||
|
||
# Compress logs, as they are text and compression will save a lot of disk space | ||
compress | ||
|
||
# Don't compress the log immediately to avoid errors about "file size changed while zipping" | ||
delaycompress | ||
|
||
# Don't run the postrotate script for each file configured in this file, but | ||
# run it only once if one or more files were rotated | ||
sharedscripts | ||
|
||
# After each rotation, run this custom script to flush the logs. Note that | ||
# this assumes that the mariadb-admin command has database access, which it | ||
# has thanks to the default use of Unix socket authentication for the 'root' | ||
# account used everywhere since MariaDB 10.4. | ||
postrotate | ||
if test -x /etc/mysql/debian.cnf | ||
then | ||
EXTRAPARAM='--defaults-file=/etc/mysql/debian.cnf' | ||
fi | ||
|
||
if test -x @bindir@/mariadb-admin | ||
then | ||
@bindir@/mariadb-admin $EXTRAPARAM --local flush-error-log \ | ||
flush-engine-log flush-general-log flush-slow-log | ||
fi | ||
endscript | ||
} |
This file was deleted.
Oops, something went wrong.