You are not logged in.
I don't understand this issue so I am posting this here. I noticed today that I had an issue with restarting MySQL on my server:
1. I verify MySQL is not running:
[root@ghost /]# ps -ef | grep -i "mysqld"
root 1706 1216 0 16:45 pts/0 00:00:00 grep --color=auto -i mysqld2. I start the 'mysqld' service:
[root@ghost /]# /etc/rc.d/mysqld start
:: Starting MySQL Server [DONE]3. I verify that the daemon is running:
[root@ghost /]# ps -ef | grep -i "mysqld"
root 1715 1 0 16:45 pts/0 00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql
mysql 1813 1715 0 16:45 pts/0 00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/ghost.err --pid-file=/var/lib/mysql/ghost.pid --socket=/var/run/mysqld/mysqld.sock --port=33064. I then run the command to restart the daemon for MySQL and it fails...
[root@ghost /]# /etc/rc.d/mysqld restart
:: Stopping MySQL Server [DONE]
:: Starting MySQL Server [FAIL]I can use the 'start' and 'stop' commands for /etc/rc.d/mysqld but 'restart' for some reason fails and this concerns me. Can anyone help me understand what is wrong?
./
Offline
Check your log files for any info from the mysql daemon and post what you find. On a restart does the "stop" show a fail, or the "start", or both?
Offline
No fails in logs at all. When I restart, it sucessfully stops but fails to start the daemon. I was told this:
When you stop MySQL, the kill command completes immediately, while MySQL
is still doing shutdown tasks to make sure the database is in a
consistent state. As MySQL is still running when you try to start it, it
will fail to do so.
There's 2 ways to fix this:
- use mysqladmin shutdown, needs a user in the database with process
privileges, this is the way used by debian
- implement a loop that waits for MySQL to shutdown after executing the
kill command. This is what the upstream MySQL start/stop script does.
I don't know if this is correct or not but it seems strange to me...
./
Offline
Maybe this is the problem, i mean, when you use restart to stop and start the daemon, Mysql cannot shutdown immediately and when it is started get the problem. Only guessing.
Last edited by n0dix (2010-03-24 18:17:06)
Offline
I understand what you're saying but I would think developers would have noticed this and work something into the 'restart' script for the MySQL package. I don't have this problem on any other distribution except Arch Linux. In my opinion the script should work as expected. I will file a bug and hope someone gets this resolved. If MySQL can 'restart' properly for Debian, I would think the same can be done for Arch Linux.
I guess I really posted here to see if anyone else running MySQL can replicate the problem.
./
Offline
I tried a restart on my system and got the same problem. I don't know if this is the way it always worked or if this is a new issue.
Offline
Try editing the line /etc/rc.d/mysqld from this:
restart)
$0 stop
sleep 3
$0 startTo this:
restart)
$0 stop
sleep 8
$0 startSeems like it's not getting enough time to shut down properly since it works normally on a 'start' call.
Offline
Thanks! That looks / sounds promising. I will give it a shot and report back.
Am I the only person running MySQL who has a failure upon 'restart' like shown above? I was expecting fellow Arch users to also report they get the same thing but nobody has done so and I am wondering if I am the only one or if it's something only on my system.
Last edited by Carlwill (2010-03-29 12:55:01)
./
Offline
Carlwill:
I had never noticed before but mine did the same exact thing. The above fix did the trick, though.
![]()
Offline
Thanks! Worked for me too.
./
Offline
Has anyone filed one? If not I am going to...
./
Offline