Bug 172426

Summary: Timeout error occurred trying to start MySQL daemon
Product: [Fedora] Fedora Reporter: Remy Chibois <rchibois>
Component: mysqlAssignee: Tom Lane <tgl>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 4CC: deisenst, hhorak, redhat-bugzilla
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-11-15 04:06:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Remy Chibois 2005-11-04 10:14:35 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.0.7-1.1.fc4 Firefox/1.0.7

Description of problem:
When restarting MySQL daemon using '/etc/init.d/mysqld' or 'service mysqld restart', the message "Timeout error occurred trying to start MySQL daemon" is displayed and restart fails.



Version-Release number of selected component (if applicable):
mysql-4.1.14-1.FC4.1

How reproducible:
Sometimes

Steps to Reproduce:
1. service mysqld restart
  

Actual Results:  root@localhost ~# service mysqld restart
Stopping MySQL:                                            [  OK  ]
Timeout error occurred trying to start MySQL Daemon.
Starting MySQL:                                            [FAILED]

Expected Results:  root@localhost ~# service mysqld restart
Stopping MySQL:                                            [  OK  ]
Starting MySQL:                                            [  OK  ]

Additional info:

It appears the 'stop()' function in '/etc/init.d/mysqld' does not wait for MySQL daemon to stop. It sends a SIGTERM to the process and removes the lock file and the socket file immediately, even if the process is still shutting down.

Changing the 'stop()' function to:

stop(){
    MPID=`cat "$mypidfile" 2>/dev/null`
    /bin/kill `cat "$mypidfile"  2>/dev/null ` >/dev/null 2>&1
    ret=$?

    if [ -n "$MPID" ]; then
        while kill -0 $MPID 2>/dev/null; do
            sleep 1
        done
    fi

    if [ $ret -eq 0 ]; then
    ...
}

Comment 1 Tom Lane 2005-11-15 04:06:08 UTC
I've put a loop similar to this into the latest updates (4.1.15 and 5.0.15).  Not sure why the issue hasn't 
come up before; perhaps recent versions of MySQL take longer to shut down than they used to?

Comment 2 Remy Chibois 2005-11-29 10:01:38 UTC
Thanks for this fix.
Concerning shutdown/restart speed, the machine was not that powerfull (an old
PIII) and somewhat loaded. This might explain this "special" case.

Comment 3 David Eisenstein 2005-12-15 07:41:57 UTC
Does this affect FC3 as well?

Comment 4 Tom Lane 2005-12-15 13:53:07 UTC
I think the Fedora Legacy guys already took care of it --- see bug #152531

Comment 5 David Eisenstein 2005-12-16 02:00:51 UTC
Fedora Legacy guys have not taken care of this bug.  At this moment, Legacy
maintains RHL7.3, RHL9, FC1 and FC2.  FC3 is not on the Fedora Legacy project's
maintanence list yet.

I'll open a new bug for this.  Thanks, Tom.