Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 90471 - mysql init script returns with "eend $?" while mysqld is not ready to accept connections
Summary: mysql init script returns with "eend $?" while mysqld is not ready to accept ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Linux MySQL bugs team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-26 02:29 UTC by Alexander Stoll
Modified: 2005-05-23 14:34 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
etc_init.d_mysql.patch (etc_init.d_mysql.patch,863 bytes, patch)
2005-04-26 06:08 UTC, Francesco R. (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Stoll 2005-04-26 02:29:32 UTC
The mysql init scrip fires up mysqld-safe which is a shellscript as well with the commandline option "--background" and returns immediately while the mysqld is not started and capable to accept connections. This prevents depending services like gld (see bug #88574) from proper startup.
Since someone comes up with a better solution, I suggest to add a "sleep 3" before "eend $?" in the init script to give mysql time to start the daemon process and accept connections before returning.

Reproducible: Always
Steps to Reproduce:
please look at bug #88574
Comment 1 Francesco R. (RETIRED) gentoo-dev 2005-04-26 06:01:25 UTC
This patch should do the work, it's based on the creation of MySQL socket file.

The function "mysql_get_socket" skip some checks because it's called after checkconfig.

Comment 2 Francesco R. (RETIRED) gentoo-dev 2005-04-26 06:08:44 UTC
Created attachment 57280 [details, diff]
etc_init.d_mysql.patch
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2005-05-17 02:24:40 UTC
fixed in 4.0.24-r2 and 4.1.12
Comment 4 Ginsu 2005-05-18 17:19:59 UTC
I still get !! on 4.1.12.
Comment 5 Francesco R. (RETIRED) gentoo-dev 2005-05-19 00:31:38 UTC
@Ron
try to mannually copy "/usr/portage/dev-db/mysql/files/mysql-4.0.24-r2.rc6" in
"/etc/init.d/mysql" .
Probably this last one is not updated
Comment 6 Ginsu 2005-05-19 02:43:35 UTC
The diff turns up nothing.  It got updated properly.  I noticed right away it
was different, it says

Starting mysqld (/etc/mysql/my.cnf)

when i start it.
Comment 7 Ginsu 2005-05-23 14:34:40 UTC
Well seeing as no one else seems to be having problems with this, I figured I'd
try to understnad why it's not working on my box.  My first problem seems to be
with the stop() routine.  If I run /etc/init.d/mysql stop it returns within less
then a second, but mysql is still running afterward.  But if I manually run the
start-stop-daemon command it takes about 2 seconds and mysql is properly killed
afterwards.  My second problem is with start().  retstatus is set to $? right
after the command is run, and it is 1.  But I dont see anywhere where it gets
set to 0 after the script has determined mysql has actually started.