Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1145455

Summary: systemctl start mariadb - hangs if sock file is used by another process
Product: Red Hat Enterprise Linux 7 Reporter: Branislav Blaškovič <bblaskov>
Component: mariadbAssignee: Michal Schorm <mschorm>
Status: CLOSED CURRENTRELEASE QA Contact: qe-baseos-daemons
Severity: low Docs Contact:
Priority: high    
Version: 7.1CC: bgollahe, databases-maint, hhorak, kvolny, toneata, vdanek
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Previously, the mysqladmin tool waited for an inadequate length of time if the socket it listened on did not respond in a specific way. Consequently, when the socket was used while the MariaDB server was starting, the mariadb service became unresponsive for a long time. With this update, the mysqladmin timeout has been shortened to 2 seconds. As a result, the mariadb service either starts or fails but no longer hangs in the described situation.
Story Points: ---
Clone Of:
: 1584023 (view as bug list) Environment:
Last Closed: 2018-10-30 15:42:56 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:
Embargoed:
Bug Depends On:    
Bug Blocks: 1400961, 1472751, 1584023    

Description Branislav Blaškovič 2014-09-23 06:33:06 UTC
Description of problem:
If I listen on sock file which is the same for mariadb, starting of mariadb service hangs.

Version-Release number of selected component (if applicable):
mariadb-server-5.5.35-3.el7.x86_64

How reproducible:
always

Steps to Reproduce:
# systemctl stop mariadb
# ls /var/lib/mysql/mysql.sock
ls: cannot access /var/lib/mysql/mysql.sock: No such file or directory
# nc -k -l -U /var/lib/mysql/mysql.sock &
# chown mysql:mysql /var/lib/mysql/mysql.sock
# restorecon -v /var/lib/mysql/mysql.sock
restorecon reset /var/lib/mysql/mysql.sock context unconfined_u:object_r:mysqld_db_t:s0->unconfined_u:object_r:mysqld_var_run_t:s0
# systemctl start mariadb
.. it hangs here ..

Comment 2 Honza Horak 2015-03-14 19:38:51 UTC
This issue is caused by mysqladmin pinging the socket file and this tool expects the socket responds in a specific way, which doesn't happen (nc doesn't respond) and the mysqladmin tool waits for too long time by default. This time may either be shortened by using --connect-timeout=10 for example (shortens the hang to 10s) or better to use a check if socket is used before actually starting the daemon process, similar to what Fedora does:

http://pkgs.fedoraproject.org/cgit/mariadb.git/tree/mysql-check-socket.sh?id=c9d7d6f31d5f8ad7979201b65c03cb7fec4fd157

What is important, this shouldn't be a real issue, since if another mysql daemon is using the socket, the daemon's respond is sane and mysqladmin doesn't hang.