The rc.d script shipped with the port of mysql server exits immediately after mysqld starts. This normally wouldn't be a problem but the mysql daemon exits about a second before it has established it's unix domain listening socket: "/tmp/mysql". The problem here is that the rc startup system can queue the next daemon to start before "/tmp/mysql" is available. If the next daemon needs mysql it will fail and exit. On my system rcorder starts mysql-server and then immediately follows up with jabberd. Since mysql doesn't appear ready for about a second jabberd fails and exits.
I've attached a patch which waits for up to 15 seconds for the /tmp/mysql socket to appear in the filesystem and exits as soon as it's available. This allows the next daemon in line to startup properly if it needs mysql. Note that I have had this problem with postfix up until I removed my mail information from mysql.
Fix: This may not adhere to the strictest rules of the rcorder system but my solution is to hack the provider's (mysql-server) startup script. The goal was to prevent the script from exiting until either the listening socket is established or a 15 second timeout has passed.
A better solution would be for mysqld to establish the listening socket first (even if it ignores incoming connections for a little bit) but that's much higher effort.
Patch attached with submission follows:
How-To-Repeat: Build a system that uses mysql and jabber or postfix. Ensure that jabberd starts after mysql by hacking /usr/local/etc/rc.d/jabberd's ## REQUIRES line. Assuming you're not on some hot rod of a machine check your logs for jabberd2's failure line in the service manager.
Over to maintainer (via the GNATS Auto Assign Tool)
ale 2008-06-07 08:33:50 UTC
FreeBSD ports repository
databases/mysql51-server Makefile distinfo
Update to 5.1.25-rc release.
Fix startup script to wait until server is completely up. 
PR: ports/122063 
Submitted by: Christopher Sean Hilton <firstname.lastname@example.org> 
Revision Changes Path
1.232 +2 -2 ports/databases/mysql51-server/Makefile
1.103 +3 -3 ports/databases/mysql51-server/distinfo
1.5 +12 -1 ports/databases/mysql51-server/files/mysql-server.sh.in
email@example.com mailing list
To unsubscribe, send any mail to "firstname.lastname@example.org"
A slightly different patch has been applied, thanks.