In our DBs where there is still the mariadb-server-5.5 package or it was removed without the purge option, we still have /etc/logrotate.d/mysql-server that runs every day.
A bunch of things are wrong here:
- Because the default logrotate from the package don't have the option notifempty, it tries to rotate the empty logs in /var/log
- Then it fails to run the flush-logs command exiting with EXIT_STATUS=1 hence the email spam.
The reasons why it can't run the flush-logs command are:
- Wrong socket path in /etc/mysql/debian.cnf: /var/run/mysqld/mysqld.sock instead of /tmp/mysql.sock
- Missing grant for 'debian-sys-maint'@'localhost'
To avoid the spam the quickest solution is to ensure that the /etc/logrotate.d/mysql-server file is not present from puppet given that is not useful in any case and present only in some server and then decide our custom logrotation in T127636