Description:
The Mac OS X Startup Item calls the mysql.server script to handle start, stop, and restart chores.
The mysql.server script calculates the default pid-file name based on the current hostname of the
computer.
The Mac OS X hostname may change due to network configuration changes (such as wireless
connectivity coming and going); when this occurs, the default pid file name changes, which
means that the pid-file name used at start time will not be found when it is time to stop or restart
the server.
To fix that, the patch below passes a fixed pid file name into the mysql.server script so that the
pid file will always be found despite changes to the network configuration.
This patch relies on bug fixes to the mysql.server script, which are detailed in bug #5120.
How to repeat:
At startup time, before my wireless network has come up, my hostname is "James.local".
Subsequently, once wireless connectivity is established, my hostname changes to something
else. So the pid file name picked at the time the MySQLCOM Startup Item is called is different
than when system starter is later called to do a restart or stop operation; these operations thus
fail.
Suggested fix:
The following patch solves this problem by requesting that a pid-file of a constant name is used
by the MySQLCOM startup item. Note that this relies on bug fixes to the mysql.server script,
which are detailed in bug #5120.
diff -u MySQLCOM MySQLCOM.patched
--- MySQLCOM Thu Aug 19 23:11:13 2004
+++ MySQLCOM.patched Thu Aug 19 21:58:58 2004
@@ -25,25 +25,26 @@
# The path to the mysql.server init script. The official MySQL
# Mac OS X packages are being installed into /usr/local/mysql.
SCRIPT="/usr/local/mysql/support-files/mysql.server"
+SCRIPTARGS="--pid-file=mysql.pid"
StartService ()
{
if [ "${MYSQLCOM:=-NO-}" = "-YES-" ] ; then
ConsoleMessage "Starting MySQL database server"
- $SCRIPT start > /dev/null 2>&1
+ $SCRIPT start $SCRIPTARGS > /dev/null 2>&1
fi
}
StopService ()
{
ConsoleMessage "Stopping MySQL database server"
- $SCRIPT stop > /dev/null 2>&1
+ $SCRIPT stop $SCRIPTARGS > /dev/null 2>&1
}
RestartService ()
{
ConsoleMessage "Restarting MySQL database server"
- $SCRIPT restart > /dev/null 2>&1
+ $SCRIPT restart $SCRIPTARGS > /dev/null 2>&1
}
if test -x $SCRIPT ; then