Symptoms
Error messages with the following content are sent to the administrator daily:
/etc/cron.daily/logrotate:
logrotate_script: 3: [: /var/run/mysqld/mysqld.pid: unexpected operatorRunning MariaDB logrotate manually shows the same error:
# /usr/sbin/logrotate /etc/logrotate.d/mysql-server -f
logrotate_script: 3: [: /var/run/mysqld/mysqld.pid: unexpected operator
Cause
Bug MDEV-11884 in MariaDB Debian/Ubuntu packaging, which is planned to be fixed in version 10.5.
Resolution
If MariaDB was installed from the OS repositories (default)
Connect to the server via SSH.
Install the latest updates:
# apt update && apt upgrade
If MariaDB was installed from unofficial repositories (manually)
Warning: the following solution should be applied at your own risk. It is recommended to use the OS repositories for database servers.
Connect to the server via SSH.
Modify the
/etc/logrotate.d/mysql-serverfile as per the solution suggested in the MariaDB bugtracker.