Bug 185955 - mysql new socket location causes init script to report FAILED start-up
mysql new socket location causes init script to report FAILED start-up
Product: Fedora
Classification: Fedora
Component: mysql (Show other bugs)
All Linux
medium Severity low
: ---
: ---
Assigned To: Tom Lane
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2006-03-20 08:53 EST by Hans Kramer
Modified: 2013-07-02 23:09 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-03-10 00:14:41 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Hans Kramer 2006-03-20 08:53:25 EST
Description of problem:
After change of socket location in /etc/my.conf the init script
/etc/init.d/mysqld is unable to establish whether the mysql server
has started

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. edit /etc/mysql and change socket option
2. restart mysqld : service mysqld restart
Actual results:
mysql is started however the init reported FAILED after a 30 seconds timeout

Expected results:
report OK

Additional info:
Straightforward work around in init script:
specify --socket in mysqladmin call in start() function.
I have "hacked" this in the following way:

     75         # Spin for a maximum of N seconds waiting for the server to come up.
     76         # Rather than assuming we know a valid username, accept an "access
     77         # denied" response as meaning the server is functioning.
>>>  78         eval $(grep ^socket /etc/my.cnf)
     79         if [ $ret -eq 0 ]; then
     80             STARTTIMEOUT=30
     81             while [ $STARTTIMEOUT -gt 0 ]; do
>>>  82                 RESPONSE=`/usr/bin/mysqladmin -uUNKNOWN_MYSQL_USER
--socket=$socket ping 2>&1` && brea        k
     83                 echo "$RESPONSE" | grep -q "Access denied for user" && break
     84                 sleep 1
     85                 let STARTTIMEOUT=${STARTTIMEOUT}-1
     86             done
     87             if [ $STARTTIMEOUT -eq 0 ]; then
     88                     echo "Timeout error occurred trying to start MySQL
     89                     action $"Starting $prog: " /bin/false
     90             else
     91                     action $"Starting $prog: " /bin/true
     92             fi
     93         else
     94             action $"Starting $prog: " /bin/false
     95         fi

A better solution would be if mysql would read in the /etc/my.conf file like
/usr/bin/mysqld_safe does!!!! Couldn't find that option for mysqladmin though...
grrrrr mysql....
Comment 1 Tom Lane 2006-05-11 21:15:55 EDT
Seems like the issue here is whether the socket option is in the right section of /etc/my.cnf.  It's in 
[mysqld] at the moment so it's not that surprising if only mysqld pays attention.  I wonder if there is 
another section name we should put it under?
Comment 2 Christian Iseli 2007-01-19 19:15:16 EST
This report targets the FC3 or FC4 products, which have now been EOL'd.

Could you please check that it still applies to a current Fedora release, and
either update the target product or close it ?

Comment 3 petrosyan 2008-03-10 00:14:41 EDT
Fedora Core 4 is no longer maintained.

Setting status to "INSUFFICIENT_DATA". If you can reproduce this bug in the
current Fedora release, please reopen this bug and assign it to the
corresponding Fedora version.

Note You need to log in before you can comment on or make changes to this bug.