When I say sudo /etc/init.d/mysql restart
on Ubuntu 8.04.2 sometimes there remains a "mysql_safe" process eating 99% of cpu. Making the machine practically inusable.
Is there a better way to restart mysql? I thought about writing a script:
sudo /etc/init.d/mysql stop
sleep 10
sudo killall mysql_safe
sudo /etc/init.d/mysql start
But this would be a evil workaround. (And the script is just a quick shot)
I googled and found that mysql_safe is a wrapper script which starts mysqld, and makes sure it gets restarted if it should die. So there should be a better way to restart the thing.
I googled that this is a common problem in this ubuntu version. Is debian / ubuntu doing it wrong at this point? The init.d script looks quite sophisticated and it deals with mysql_safe also, but my skills are not good enough to understand it fully. But this would be the best place to improve. This is a paste of the version on my machine (which is untouched): http://pastie.org/421938
I found many hints but I would like this resolved to a certain degree of reliability for production servers.
EDIT:
It seems to be exactly this unsolved bug: https://bugs.launchpad.net/ubuntu/+source/mysql-dfsg-5.0/+bug/105457
Maybe it is this bug from the mysql site: http://bugs.mysql.com/bug.php?id=36550
This seems related or identical: http://forum.slicehost.com/comments.php?DiscussionID=1000
Some people talk of a race condition with 2 instances of mysql_safe. Others suggest commentiong out the sanity check in the startup script.
Karl