<div dir="ltr"><br><div><b>$ dpkg -S /etc/logrotate.d/mysql-server</b></div><div><br></div>mariadb-server-10.5: /etc/logrotate.d/mysql-server<br><br><br><br><div><b>$ find /etc/logrotate.d/m* -ls</b></div><div><b><br></b></div> 4857005 4 -rw-r--r-- 1 root root 1751 ott 16 07:32 /etc/logrotate.d/mariadb<br> 4851922 4 -rw-r--r-- 1 root root 800 ott 20 11:34 /etc/logrotate.d/mysql-server<br><br> <br> <br><b>$ cat /etc/logrotate.d/mariadb</b><br><br># This is the MariaDB configuration for the logrotate utility<br>#<br># Note that on most Linux systems logs are written to journald, which has its<br># own rotation scheme.<br>#<br># Read <a href="https://mariadb.com/kb/en/error-log/">https://mariadb.com/kb/en/error-log/</a> to learn more about logging and<br># <a href="https://mariadb.com/kb/en/rotating-logs-on-unix-and-linux/">https://mariadb.com/kb/en/rotating-logs-on-unix-and-linux/</a> about rotating logs.<br><br>/var/lib/mysql/mysqld.log /mysql.log /var/lib/mysql/mariadb.log /mysql-slow.log /mariadb-slow.log /error.log {<br><br> # If any of the files listed above is missing, skip them silently without<br> # emitting any errors<br> missingok<br><br> # If file exists but is empty, don't rotate it<br> notifempty<br><br> # Run daily<br> daily<br><br> # Keep one week of logs<br> rotate 7<br><br> # If file is growing too big, rotate immediately<br> maxsize 100M<br><br> # Compress logs, as they are text and compression will save a lot of disk space<br> compress<br><br> # Don't compress the log immediately to avoid errors about "file size changed while zipping"<br> delaycompress<br><br> # Don't run the postrotate script for each file configured in this file, but<br> # run it only once if one or more files were rotated<br> sharedscripts<br><br> # After each rotation, run this custom script to flush the logs. Note that<br> # this assumes that the mariadb-admin command has database access, which it<br> # has thanks to the default use of Unix socket authentication for the 'root'<br> # account used everywhere since MariaDB 10.4.<br> postrotate<br> if test -x /etc/mysql/debian.cnf<br> then<br> EXTRAPARAM='--defaults-file=/etc/mysql/debian.cnf'<br> fi<br><br> if test -x /usr/bin/mariadb-admin && \<br> /usr/bin/mariadb-admin ping &>/dev/null<br> then<br> /usr/bin/mariadb-admin $EXTRAPARAM --local flush-error-log \<br> flush-engine-log flush-general-log flush-slow-log<br> fi<br> endscript<br>}<br><br><br><br><b>$ cat /etc/logrotate.d/mysql-server</b><br><br># - I put everything in one block and added sharedscripts, so that mysql gets<br># flush-logs'd only once.<br># Else the binary logs would automatically increase by n times every day.<br># - The error log is obsolete, messages go to syslog now.<br>/var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log /var/log/mysql/mariadb-slow.log /var/log/mysql/error.log {<br> daily<br> rotate 7<br> missingok<br> create 640 mysql adm<br> compress<br> sharedscripts<br> postrotate<br> test -x /usr/bin/mysqladmin || exit 0<br> if [ -f `<b>my_print_defaults --mariadb</b> | grep -oP "pid-file=\K[^$]+"` ]; then<br> # If this fails, check debian.conf!<br> mysqladmin --defaults-file=/etc/mysql/debian.cnf --local flush-error-log \<br> flush-engine-log flush-general-log flush-slow-log<br> fi<br> endscript<br><div>}</div><div><font face="arial,sans-serif"><br></font></div><div><font face="arial,sans-serif"><br></font></div><div><b><font face="arial,sans-serif"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">$ my_print_defaults --mariadb</span></font></b></div><div><font face="arial,sans-serif"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)"></span><br>my_print_defaults: unknown option '--mariadb'<br></font></div><div><font face="arial,sans-serif"><br></font></div><div><font face="arial,sans-serif"><br></font></div><div><font face="arial,sans-serif">but if I change with --mysqld it would seem ok:</font></div><div><font face="arial,sans-serif"><br></font></div><div><font face="arial,sans-serif"><b><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">$ my_print_defaults --mysqld </span></b></font></div><div><font face="arial,sans-serif"><br></font></div><div><font face="arial,sans-serif">--socket=/run/mysqld/mysqld.sock
<br>--user=mysql
<br>--pid-file=/run/mysqld/mysqld.pid
<br>--basedir=/usr
<br>--datadir=/var/lib/mysql
<br>--tmpdir=/tmp
<br>--lc-messages-dir=/usr/share/mysql
<br>--lc-messages=en_US
<br>--skip-external-locking
<br>--bind-address=127.0.0.1
<br>--expire_logs_days=10
<br>--character-set-server=utf8mb4
<br>--collation-server=utf8mb4_general_ci</font></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><br></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><br></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><br></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><b><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">$ my_print_defaults </span></b></span></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><br></span></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace">my_print_defaults Ver 1.7 for debian-linux-gnu at x86_64
<br>This software comes with ABSOLUTELY NO WARRANTY. This is free software,
<br>and you are welcome to modify and redistribute it under the GPL license
<br>
<br>Prints all arguments that is give to some program using the default files
<br>Usage: my_print_defaults [OPTIONS] [groups]
<br> -#, --debug[=#] This is a non-debug version. Catch this and exit
<br> -c, --defaults-file=name <br> Read this file only, do not read global or per-user
<br> config files; should be the first option
<br> -e, --defaults-extra-file=name <br> Read this file after the global config file and before
<br> the config file in the users home directory; should be
<br> the first option
<br> -g, --defaults-group-suffix=name <br> In addition to the given groups, read also groups with
<br> this suffix
<br> <b>--mysqld Read the same set of groups that the mysqld binary does.
</b><br> -n, --no-defaults Return an empty string (useful for scripts).
<br> -?, --help Display this help message and exit.
<br> -v, --verbose Increase the output level
<br> -V, --version Output version information and exit.
<br>
<br>Default options are read from the following files in the given order:
<br>/etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf <br>
<br>Variables (--variable-name=value)
<br>and boolean options {FALSE|TRUE} Value (after reading options)
<br>--------------------------------- ----------------------------------------
<br>defaults-file my
<br>defaults-extra-file (No default value)
<br>defaults-group-suffix (No default value)
<br>mysqld FALSE
<br>
<br>Example usage:
<br>my_print_defaults --defaults-file=example.cnf client client-server mysql</span></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><br></span></span></span></span></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno mar 20 ott 2020 alle ore 10:39 Otto Kekäläinen <<a href="mailto:otto@debian.org">otto@debian.org</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello!<br>
<br>
Just to make sure, what does this say on your system?<br>
<br>
dpkg -S /etc/logrotate.d/mysql-server<br>
<br>
and<br>
<br>
find /etc/logrotate.d/m* -ls<br>
<br>
<br>
Maybe the problem is not the contents of the file, but that the file<br>
is there at all after an upgrade.<br>
</blockquote></div>