Bug 188352

Summary: databases/mysql55-server rc script returns before mysqld is running.
Product: Ports & Packages Reporter: Mathieu Arnold <mat>
Component: Individual Port(s)Assignee: Alex Dupre <ale>
Status: Closed Unable to Reproduce    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Mathieu Arnold freebsd_committer freebsd_triage 2014-04-07 16:40:00 UTC
At startup, the mysql-server rc script returns a few seconds before the mysql
server is really up, running and able to accept connections requests.

Fix: 

In the mysql_poststart function, maybe test for /tmp/mysql.sock's existence,
and that a server is accepting connections with it, or something.
How-To-Repeat: 
Install mysql*-server any port that needs it and reboot.

The ones I have problems with are:

ports-mgmt/tinderbox on the redports cluster, where I added a dummy rc script
with a sleep 10 that REQUIRES: mysql-server and BEFORE: tinderd.

dns/opendnssec on my company's DNS servers, I rebooted it today, one of the
daemons that come with it exited with:

Apr  7 17:05:39 ns1 ods-enforcerd: ERROR: unable to connect to database - Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2014-04-07 16:40:11 UTC
Responsible Changed
From-To: freebsd-ports-bugs->ale

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Alex Dupre freebsd_committer freebsd_triage 2014-04-07 16:57:34 UTC
It's strange, because the pid file is created when the server is ready
to accept connections. Before, we used to use mysqladmin to check if
mysql has started, but they should be equivalent. Can you try to restore
the following behavior and see if it makes any difference?

http://svnweb.freebsd.org/ports/head/databases/mysql50-server/files/mysql-server.sh.in?r1=217836&r2=242018&pathrev=250000

-- 
Alex Dupre
Comment 3 Alex Dupre freebsd_committer freebsd_triage 2014-06-03 12:26:59 UTC
Hey mat, do you still see the issue? Can you try the proposed patch?
Comment 4 Mathieu Arnold freebsd_committer freebsd_triage 2014-06-06 12:23:00 UTC
(In reply to Alex Dupre from comment #3)
> Hey mat, do you still see the issue? Can you try the proposed patch?

Yes, I still have the issue (I did freebsd-update install; reboot today on the machine where I have opendnssec, and the daemons failed to start because of that.)

I'll try to see if the patch you proposed fixes it later this month. (Pretty busy at work at the moment.)
Comment 5 Mathieu Arnold freebsd_committer freebsd_triage 2014-11-05 15:58:57 UTC
I spent two hours rebooting servers, and I can't seem to reproduce the problem any more, so, just say it is fixed.