Bug #9507 /etc/init.d/mysql script does not stop mysqld correctly
Submitted: 31 Mar 2005 1:01 Modified: 31 Mar 2005 11:58
Reporter: Petr Chardin Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Installing Severity:S2 (Serious)
Version:mysql-5.0.3-beta OS:Linux (Suse Linux 9.1)
Assigned to: Petr Chardin CPU Architecture:Any

[31 Mar 2005 1:01] Petr Chardin
Description:
Not sure that "installing" is the right category for this bug, but anyway

After issuing command "/etc/init.d/mysql stop", we get the following message:

Shutting down MySQL...................................              failed

The mesage is printed, while mysqld is stopped in fact. This is due to incorrect implementation of wait_for_pid () function in startup script.

How to repeat:
install MySQL 5.0.3-beta and attempt to stop it with
/etc/init.d/mysql stop

Suggested fix:
wait_for_pid () function checks for existence of the pid file. For "start" this function should wait for the pid file to appear, and for "stop" it should wait for it to wanish.  However, it only waits for the file to appear in both cases. This is obviously wrong. The patch with the fix will be comitted soon.
[31 Mar 2005 2:32] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/23517
[31 Mar 2005 9:15] Petr Chardin
4.1 affected as well
[31 Mar 2005 10:23] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/23522
[31 Mar 2005 11:58] Petr Chardin
pushed in 4.1 tree, will be in 5.0 with the next merge