|
|
10.5: Control MySQL server with launchd
When added to the launchd plist, the following works for launching a MySQL server installed via MacPorts under Tiger:
The same should work for other instances of MySQL using UNIX sockets if you change the value of SockPathName. You might need to add a "SockPathMode" property.
For IP sockets, try adding the following to the "Sockets" dict:
I suspect this won't work, as launchd binds to the mysql port and MySQL servers don't AFAIK support passing sockets a la inetd.
10.5: Control MySQL server with launchd
Another note for Tiger users: use the "OnDemand" key rather than "KeepAlive". "OnDemand" is supported but deprecated in Leopard.
10.5: Control MySQL server with launchd
Using the Sockets key to "on-demand" start the MySQL server only works partly and by accident. The Sockets key requires the job to use a launch API (launchd.plist.5). Using the above config causes launchd to create the socket in /tmp/mysql.sock, and when the client connects launchd notices and starts the server. The MySQL server sees that the socket exists but it doesn't expect it to, as it didn't create it, so removes it and creates its own. From then on all is business as usual. Meanwhile the first client is left hanging on a socket that has now been unlinked and won't ever be answered. This has been tested on 10.5.5, MySQL 5.0.75 installed via Macports.
Also if the server exits (is shutdown or crashes), I'm not sure that launchd will recreate it.
So it doesn't look like it's possible to start the mysqld server on-demand, at least until someone adds launchd support to mysql.
|
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.15 seconds |
|