Bug 142328 - mysqld init script "ping" timeout test fails
mysqld init script "ping" timeout test fails
Product: Fedora
Classification: Fedora
Component: mysql (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tom Lane
David Lawrence
: 137438 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2004-12-08 18:09 EST by Jeremy Laidman
Modified: 2013-07-02 23:03 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-03-21 17:01:43 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Patch to init script that works for me (1.16 KB, patch)
2004-12-08 18:12 EST, Jeremy Laidman
no flags Details | Diff
Different patch that's a bit less cludgy (1.23 KB, text/plain)
2004-12-09 06:18 EST, Jeremy Laidman
no flags Details
Patch allows non-anonymous ping check by using username from sysconfig (981 bytes, patch)
2004-12-28 18:47 EST, Richard Hughes
no flags Details | Diff

  None (edit)
Description Jeremy Laidman 2004-12-08 18:09:28 EST
Description of problem:

After upgrading to mysql-server 3.23.58, the init script reports a
failure to start mysqld, saying "Timeout error occurred trying to
start MySQL Daemon."  Not sure if this is due to removal of anonymous
users, as suggested by comments in the init script.

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

mysql-server 3.23.58

How reproducible:

 stops the running service, then shows message   "ps -ef" shows mysql
process, and "service mysql stop" works too.

Steps to Reproduce:
1. execute "service mysql restart"
2. notice "Timeout error occurred trying to start MySQL Daemon." message
3. execute "ps -ef | grep mysql" and notice that mysqld is running
Actual results:

reports "Timeout error occurred trying to start MySQL Daemon."

Expected results:

should report "Starting MySQL:  [ OK ]"

Additional info:

Attaching a patch that works for me.
Comment 1 Jeremy Laidman 2004-12-08 18:12:31 EST
Created attachment 108158 [details]
Patch to init script that works for me

It seems that I get no STDOUT output for an authentication failure, same as a
failed connection.  Instead, we grab the STDERR and grep for the string "Check
that mysql is running".
Comment 2 Tom Lane 2004-12-08 20:58:28 EST
Hmm ... that's a bit klugy but it's better than no solution at all. 
Thanks for the suggestion!
Comment 3 Tom Lane 2004-12-08 21:02:47 EST
*** Bug 137438 has been marked as a duplicate of this bug. ***
Comment 4 Jeremy Laidman 2004-12-09 06:17:05 EST
I see what you mean.  Rather than look for a failure to connect, and
assuming all is OK when not found, better to test for either 1) ping
works; or 2) ping response with permission denied.

Try this patch instead...
Comment 5 Jeremy Laidman 2004-12-09 06:18:21 EST
Created attachment 108190 [details]
Different patch that's a bit less cludgy
Comment 7 Bas Mevissen 2004-12-18 13:26:16 EST
I had the same problem. The cause appeared to be that I had removed
the anonymous users (empty user names) from the databases user list.

Recreating them back (without any privalliges) resolved the problem.
Now my mysqld starts in a few seconds without that error.

I'm not sure if it is safe to have these users exist in a production

I think the solution is to remove the need for having such users in
the database. Maybe just check if the daemon runs or check the log
file for the word ERROR after the last "start"
Comment 8 Bas Mevissen 2004-12-18 13:29:53 EST
I just read that this is already discussed in (137438), see comment #3
in this report.

I missed that report in my query :-(
Comment 9 Tom Lane 2004-12-21 19:17:54 EST
I have applied a patch for this, based on Jeremy's work, in rawhide
(mysql 4.1.7-8) --- I'll work on rolling it into the existing release
branches later.
Comment 10 Richard Hughes 2004-12-28 18:47:59 EST
Created attachment 109161 [details]
Patch allows non-anonymous ping check by using username from sysconfig

I found this too. This is due to our security policy disallowed anonymous
access to the mysql server. 

To stop this error appearing every time I boot, I can just change the init.d
script with a new username:

ping="/usr/bin/mysqladmin -ucorrect_user ping"

This username (and optionally password) should really be set in a sysconfig
variable, not the startup script, just like pand and dhcpd do.

This optional new file /etc/sysconfig/mysqld should be mode 600.
# Username and password for mysql ping

I understand it's a slightly different issue, but similar enough to stay within
this bug. Tell me if I'm wrong, or if there's a better way to fix it.
Comment 11 Tom Lane 2005-01-05 14:15:26 EST
I have pushed out a fix for FC3 in mysql-3.23.58-14.  It will still
need to be fixed in RHEL4.
Comment 12 Tom Lane 2005-03-21 17:01:43 EST
This is now fixed in pending releases for all branches.

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