I'm using logrotate to rotate mysql output.  When cron runs logrotate, I get frequently get an e-mail with the following content:error: Compressing program wrote following message to stderr when compressing log /var/log/mysql/mysqld.err-20150408:gzip: stdin: file size changed while zippingindicating that after logrotate moved the file and called gzip on it, the file was still open and mysql was writing to it.  Here's my logrotate config for mysql:/var/log/mysql/mysql.err /var/log/mysql/mysql.log /var/log/mysql/mysqld.err {monthlycreate 660 mysql mysqlnotifemptysize 5Msharedscriptsmissingokpostrotate[ -f /var/run/mysqld/mysqld.pid ] && /bin/kill -HUP `cat /var/run/mysqld/mysqld.pid`endscript}This is the unmodified file that is shipped with Gentoo's mysql package, so I doubt there are problems with it.  I have no trouble with other logs being rotated.Any ideas what may be going on?
Why does logrotate zip a file before it is closed
logs;mysql;logrotate
The gzip error message states pretty much what is going on -- the file is being written to (by MySQL in this case) during compression. Try using delaycompress (with compress); from the man page:delaycompress Postpone compression of the previous log file to the next rotation  cycle. This only has effect when used in combination with compress. It  can be used when some program cannot be told to close its logfile and  thus might continue writing to the previous log file for some time.