[debian-mysql] Bug#588086: mysql-server-5.1: logrotate script cannot handle stopped mysqld
post at ralfj.de
Wed Apr 11 10:09:52 UTC 2012
more than a year later, this bug is still open. I sometiems need the mysql
server on my development machine, but permanently running a full-blown
database system on my everyday work laptop is a total waste of resources, so I
disabled the automatic startup of the server. That makes the postrotate script
fail - probably related to me using KDE, so there *is* a mysqld running, just
not the one the script would like to talk to.
I fixed this by adding
test -d /var/run/mysql || exit 0 # make sure the server actually runs
at the beginning of the postrotate script. Of course this will be problematic
if the server configuration is changed to use no/a different local socket, but
it's better than daily getting a complaint mail from cron.
More information about the pkg-mysql-maint