Bug 112829 - /etc/init.d/mysqld start fails but mysql is alive
Summary: /etc/init.d/mysqld start fails but mysql is alive
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: mysql
Version: 1
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Patrick Macdonald
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-01-03 01:27 UTC by Need Real Name
Modified: 2007-11-30 22:10 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-01-05 18:44:20 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Need Real Name 2004-01-03 01:27:49 UTC
Description of problem:
The script /etc/init.d/mysqld fail testing for mysql alive if the DB
is password protected.

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


How reproducible:

every time

Steps to Reproduce:
1. /etc/init.d/mysqld stop
2. /etc/init.d/mysqld start
3.
  
Actual results:
[root@localhost root]# /etc/init.d/mysqld stop
Interruzione di MySQL:                                     [  OK  ]
[root@localhost root]# /etc/init.d/mysqld start
Timeout error occurred trying to start MySQL Daemon.
Avvio di MySQL:                                            [FALLITO]


Expected results:
Avvio di MySQL:                                            [  OK  ] 

Additional info:

Comment 1 shrek-m 2004-01-04 12:20:21 UTC
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=108779


if your mysql-root has a password you have to change the user for
"mysqladmin ping"  "-u none-mysql-existing-user"

eg.
$ grep mysqladmin  /etc/init.d/mysqld
#            if [ -n "`/usr/bin/mysqladmin ping 2> /dev/null`" ]; then
            if [ -n "`/usr/bin/mysqladmin -unobody ping 2> /dev/null`"
]; then
#            if !([ -n "`/usr/bin/mysqladmin ping 2> /dev/null`" ]); then
            if !([ -n "`/usr/bin/mysqladmin -unobody ping 2>
/dev/null`" ]); then

Comment 2 Need Real Name 2004-01-04 15:52:00 UTC
I have done the changes, all is ok. Could I ask you why the command
must be " /usr/bin/mysqladmin ping 2> /dev/null " instead of = "
/usr/bin/mysqladmin ping > /dev/null " ?
In other words why 2 ? ( I am non a bash guru ( and also not a guru at
all )) :-) ( from command line /usr/bin/mysqladmin ping result ok ; 
/usr/bin/mysqladmin ping 2 result in error ).

Bye.

Luca

Comment 3 shrek-m 2004-01-05 12:16:46 UTC
perhaps should only the error(2) be redirected to /dev/null
$ mysqladmin ping 2 > /dev/null
and not the error_or_output
$ mysqladmin ping > /dev/null 2>&1

see
$ man bash
/redirection  /dirlist  /2>&1

1 = standard output
2 = standard error


i do not understand why this part  "spin for a maximum of ten seconds
..."  is in the mysqld-init-script or why it expect that the
mysql-root has no password.
afair it appeared the first time in fedora-test and is imho not necessary.

i had no problems with redhat mysqld-init-scripts since rhl 7.x

Comment 4 Patrick Macdonald 2004-01-05 18:44:20 UTC
The looping change was put in as a fix for bug #58372 in October 2003.

Glad you fixed your problem.  There is an updated init script which
points out that you may need to change the mysqladmin ping line.

Comment 5 Eero 2004-01-11 09:30:11 UTC
Is fixed package available? Damn annoying bug :)


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