On Debian Stretch with MariaDB 10.3.8, provided via the official MariaDB debian package repo, logrotation always fails, leaving the mysqld process having "disappearing" logfiles.
The problem was present in 10.2.x as well, as far as I can recall, and the logrotate script has the same issue in 10.0.x.
The problem is caused by a failing assumption in the provided logrotate script. A patch with a hotfix for the issue is included.
/etc/logrotate.d/mysql-server contains the following code:
However, this fails, because the my_print_defaults-grep pipe produces two lines of output:
This is due to my_print_defaults --mysqld printing every default twice, and thus the assumption that grep produces one line of output fails.
Hotfix: add parameter "-m 1" to the grep statement to ensure a maximum of 1 matched line, so that the postrotate section reads as follows:
A better long-term solution is described in MDEV-16621.
The hotfix assumes that the first of any duplicate print-outs is the correct one.