Bug 1042644

Summary: MySQL unable to start (after unclean shutdown) because /etc/init.d/mysqld wrongly check /var/lib/mysql/mysql.sock by -S and not by lsof
Product: Red Hat Enterprise Linux 6 Reporter: Milan Kerslager <milan.kerslager>
Component: mysqlAssignee: Honza Horak <hhorak>
Status: CLOSED DUPLICATE QA Contact: qe-baseos-daemons
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.5CC: byte, databases-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-13 08:36:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Milan Kerslager 2013-12-13 00:43:13 UTC
In mysql-server-5.1.71-1.el6.x86_64 there is a check in init script:

[ -S /var/lib/mysql/mysql.sock ]

When the socket exist (unclean shutdown for example), the mysqld did not start because this check by printing a message that this socket is in use, which is wrong. There should be check by lsof instead:

# lsof /var/lib/mysql/mysql.sock 
COMMAND   PID  USER   FD   TYPE             DEVICE SIZE/OFF   NODE NAME
mysqld  14235 mysql   12u  unix 0xffff880214ec0980      0t0 169827 /var/lib/mysql/mysql.sock

Only lsof could tell if the socket is really in use or not. If yes, the output above tells. If the socket is not in use, the output above is empty.

The workaround is to delete the socket manually before trying to start MySQL daemon.

Comment 1 Honza Horak 2013-12-13 08:36:37 UTC
Thank you for reporting, this is most probably the same issue as bug #1037650, so marking as duplicate.

*** This bug has been marked as a duplicate of bug 1037650 ***