[MacPorts] #30678: mysql5-server places socket in /var/mysql which breaks in-place upgrade from SL Server to Lion Server
#30678: mysql5-server places socket in /var/mysql which breaks in-place upgrade from SL Server to Lion Server -----------------------------------+---------------------------------------- Reporter: jeremyhu@… | Owner: ryandesign@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.1 Keywords: | Port: mysql5-server -----------------------------------+---------------------------------------- {{{ cid:~ admin$ cd /var/mysql/ cid:mysql admin$ ls -al total 0 drwxr-xr-x 2 _mysql wheel 68 Aug 9 13:53 . drwxr-xr-x 37 root wheel 1258 Aug 9 13:26 .. cid:mysql admin$ sudo launchctl start org.macports.mysql5 cid:mysql admin$ ls -al total 0 drwxr-xr-x 3 _mysql wheel 102 Aug 9 13:53 . drwxr-xr-x 37 root wheel 1258 Aug 9 13:26 .. srwxrwxrwx 1 _mysql wheel 0 Aug 9 13:53 mysql.sock }}} MacPorts should not be placing mysql.sock in /var/mysql as that is owned by Apple's MySQL server. This interference causes in-place upgrades from SL Server to Lion Server to fail. -- Ticket URL: <https://trac.macports.org/ticket/30678> MacPorts <http://www.macports.org/> Ports system for Mac OS
#30678: mysql5-server places socket in /var/mysql which breaks in-place upgrade from SL Server to Lion Server -----------------------------------+---------------------------------------- Reporter: jeremyhu@… | Owner: ryandesign@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.1 Keywords: | Port: mysql5-server -----------------------------------+---------------------------------------- Comment(by ryandesign@…): On my system it's in /opt/local/var/run/mysql5/mysqld.sock where it's supposed to be. Are you sure you haven't asked for it to be in /var/mysql/mysql.sock? Check your my.cnf settings file. -- Ticket URL: <https://trac.macports.org/ticket/30678#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS
#30678: mysql5-server places socket in /var/mysql which breaks in-place upgrade from SL Server to Lion Server -----------------------------------+---------------------------------------- Reporter: jeremyhu@… | Owner: ryandesign@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.1 Keywords: | Port: mysql5-server -----------------------------------+---------------------------------------- Comment(by jeremyhu@…): Ok, then the problem seems to be that mysql5-server doesn't install a my.cnf: {{{ $ port contents mysql5-server Port mysql5-server contains: /Library/LaunchDaemons/org.macports.mysql5.plist /opt/local/etc/LaunchDaemons/org.macports.mysql5/mysql5.wrapper /opt/local/etc/LaunchDaemons/org.macports.mysql5/org.macports.mysql5.plist /opt/local/var/db/mysql5/.turd_mysql5-server /opt/local/var/log/mysql5/.turd_mysql5-server /opt/local/var/run/mysql5/.turd_mysql5-server }}} -- Ticket URL: <https://trac.macports.org/ticket/30678#comment:2> MacPorts <http://www.macports.org/> Ports system for Mac OS
#30678: mysql5-server places socket in /var/mysql which breaks in-place upgrade from SL Server to Lion Server -----------------------------------+---------------------------------------- Reporter: jeremyhu@… | Owner: ryandesign@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.1 Keywords: | Port: mysql5-server -----------------------------------+---------------------------------------- Comment(by jeremyhu@…): So by default, it is using /var/mysql (which it shouldn't) -- Ticket URL: <https://trac.macports.org/ticket/30678#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
#30678: mysql5-server places socket in /var/mysql which breaks in-place upgrade from SL Server to Lion Server -----------------------------------+---------------------------------------- Reporter: jeremyhu@… | Owner: ryandesign@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.1 Keywords: | Port: mysql5-server -----------------------------------+---------------------------------------- Comment(by ryandesign@…): Replying to [comment:2 jeremyhu@…]:
Ok, then the problem seems to be that mysql5-server doesn't install a my.cnf:
Well no, it is correct and good and right that it doesn't install a my.cnf. Instead, the mysql5 port installs ''sample'' my.cnf files that you can copy and customize as desired. {{{ $ port contents mysql5 | grep cnf$ /opt/local/share/mysql5/mysql/my-huge.cnf /opt/local/share/mysql5/mysql/my-innodb-heavy-4G.cnf /opt/local/share/mysql5/mysql/my-large.cnf /opt/local/share/mysql5/mysql/my-medium.cnf /opt/local/share/mysql5/mysql/my-small.cnf }}} -- Ticket URL: <https://trac.macports.org/ticket/30678#comment:4> MacPorts <http://www.macports.org/> Ports system for Mac OS
#30678: mysql5-server places socket in /var/mysql which breaks in-place upgrade from SL Server to Lion Server -----------------------------------+---------------------------------------- Reporter: jeremyhu@… | Owner: ryandesign@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.1 Keywords: | Port: mysql5-server -----------------------------------+---------------------------------------- Comment(by ryandesign@…): Replying to [comment:3 jeremyhu@…]:
So by default, it is using /var/mysql (which it shouldn't)
That shouldn't be the case. mysql5 is configured with `--with-unix-socket- path=/opt/local/var/run/mysql5/mysqld.sock` so that should be the default, unless you have specified otherwise in your my.cnf. I have not specified otherwise in my my.cnf, and that is what it is on my system. Remember that mysql looks for my.cnf in many places, including /etc/my.cnf. -- Ticket URL: <https://trac.macports.org/ticket/30678#comment:5> MacPorts <http://www.macports.org/> Ports system for Mac OS
#30678: mysql5-server places socket in /var/mysql which breaks in-place upgrade from SL Server to Lion Server -----------------------------------+---------------------------------------- Reporter: jeremyhu@… | Owner: ryandesign@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.1 Keywords: | Port: mysql5-server -----------------------------------+---------------------------------------- Comment(by jeremyhu@…): Right, that's my point as to why it's wrong. It should be checking ${prefix}/etc/cnf and not /etc/my.cnf ... It should never use /etc/my.cnf because that one does not belong to it. -- Ticket URL: <https://trac.macports.org/ticket/30678#comment:6> MacPorts <http://www.macports.org/> Ports system for Mac OS
#30678: mysql5-server places socket in /var/mysql which breaks in-place upgrade from SL Server to Lion Server -----------------------------------+---------------------------------------- Reporter: jeremyhu@… | Owner: ryandesign@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.1 Keywords: | Port: mysql5-server -----------------------------------+---------------------------------------- Comment(by ryandesign@…): It does check ${prefix}/etc/mysql5/my.cnf, but all versions of MySQL—MacPorts', the official binaries, etc.—also check /etc/my.cnf. That's how MySQL is documented to function—see the paragraph beginning "On Unix, Linux and Mac OS X, MySQL programs read startup options from the following files, in the specified order" in [http://dev.mysql.com/doc/refman/5.1/en/option-files.html the MySQL documentation]—so I don't know that we should change it in MacPorts. -- Ticket URL: <https://trac.macports.org/ticket/30678#comment:7> MacPorts <http://www.macports.org/> Ports system for Mac OS
#30678: mysql5 should not read /etc/my.cnf -----------------------------------+---------------------------------------- Reporter: jeremyhu@… | Owner: ryandesign@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.1 Keywords: | Port: mysql5 -----------------------------------+---------------------------------------- Changes (by ryandesign@…): * port: mysql5-server => mysql5 -- Ticket URL: <https://trac.macports.org/ticket/30678#comment:8> MacPorts <http://www.macports.org/> Ports system for Mac OS
#30678: mysql5 should not read /etc/my.cnf -----------------------------------+---------------------------------------- Reporter: jeremyhu@… | Owner: ryandesign@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.1 Keywords: | Port: mysql5 -----------------------------------+---------------------------------------- Comment(by jeremyhu@…): What about editing the startup script to fail to start if ${prefix}/etc/my.cnf isn't present? It can print a warning message that uses should create that file. If someone really wants it to use /etc/my.cnf, they can comment that out or just use a symlink. -- Ticket URL: <https://trac.macports.org/ticket/30678#comment:9> MacPorts <http://www.macports.org/> Ports system for Mac OS
#30678: mysql5 should not read /etc/my.cnf -----------------------------------+---------------------------------------- Reporter: jeremyhu@… | Owner: ryandesign@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.1 Keywords: | Port: mysql5 -----------------------------------+---------------------------------------- Comment(by pixilla@…): Replying to [comment:9 jeremyhu@…]:
What about editing the startup script to fail to start if ${prefix}/etc/my.cnf isn't present? This would not be good. There is no documented requirement that ANY my.cnf exist. It can print a warning message that uses should create that file. If someone really wants it to use /etc/my.cnf, they can comment that out or just use a symlink. The mysql option files (my.cnf) are documented by the software authors. The MacPorts mysql5 port honors the mysql documentation.
-- Ticket URL: <https://trac.macports.org/ticket/30678#comment:10> MacPorts <http://www.macports.org/> Ports system for Mac OS
#30678: mysql5 should not read /etc/my.cnf -----------------------------------+---------------------------------------- Reporter: jeremyhu@… | Owner: ryandesign@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.1 Keywords: | Port: mysql5 -----------------------------------+---------------------------------------- Comment(by jeremyhu@…): Replying to [comment:10 pixilla@…]:
Replying to [comment:9 jeremyhu@…]:
What about editing the startup script to fail to start if ${prefix}/etc/my.cnf isn't present? This would not be good. There is no documented requirement that ANY my.cnf exist. It can print a warning message that uses should create that file. If someone really wants it to use /etc/my.cnf, they can comment that out or just use a symlink. The mysql option files (my.cnf) are documented by the software authors. The MacPorts mysql5 port honors the mysql documentation.
Right, well we have a problem in that if mysql-server is installed and not configured (as was my case because I install a ton of ports just to make sure they build and install), it can cause the server migration scripts to fail because it will result in MacPorts mysql "claiming" /var/mysql and the migration scripts will fail to migrate Apple's MySQL to that location from the previous system. How do you want to handle this? I'm fine with it being documented on the upgrade page in the wiki if we don't want to actually change the software itself. -- Ticket URL: <https://trac.macports.org/ticket/30678#comment:11> MacPorts <http://www.macports.org/> Ports system for Mac OS
#30678: mysql5 should not read /etc/my.cnf -----------------------------------+---------------------------------------- Reporter: jeremyhu@… | Owner: ryandesign@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.1 Keywords: | Port: mysql5 -----------------------------------+---------------------------------------- Comment(by ryandesign@…): It sounds like on your system you had a file /etc/my.cnf that specified that the socket should live in /var/mysql/mysql.sock, and so MacPorts MySQL honored that request, as would any other distribution of MySQL. If you had not had that file with those contents MacPorts MySQL would have used its default socket at /opt/local/var/run/mysql5/mysqld.sock. Are you saying that the file /etc/my.cnf was not created by you but was provided by Apple on Mac OS X Snow Leopard Server? If so I can see how that would cause this problem now. But I had also understood that [http://www.theregister.co.uk/2011/08/02/apple_dumps_mysql_from_mac_os_x_serv... Mac OS X Lion Server does not include MySQL anymore]. And of course Mac OS X client has never included MySQL. So I don't see how you're going to be able to migrate a Snow Leopard Server Apple MySQL setup to Lion Server anyway, without finding another way (like MacPorts) to install MySQL. By "'claiming' /var/mysql" are you saying that MacPorts mysqld was creating its socket in that directory and keeping it open? That should only have happened if MacPorts mysqld was started. And if you started MacPorts mysqld, that's a good indication that you're actually using it for something, and that perhaps Apple's migration script was right in not trying to interfere with it. -- Ticket URL: <https://trac.macports.org/ticket/30678#comment:12> MacPorts <http://www.macports.org/> Ports system for Mac OS
#30678: mysql5 should not read /etc/my.cnf -----------------------------------+---------------------------------------- Reporter: jeremyhu@… | Owner: ryandesign@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.1 Keywords: | Port: mysql5 -----------------------------------+---------------------------------------- Comment(by jeremyhu@…): Replying to [comment:12 ryandesign@…]:
Are you saying that the file /etc/my.cnf was not created by you but was provided by Apple on Mac OS X Snow Leopard Server?
Correct
If so I can see how that would cause this problem now. But I had also understood that [http://www.theregister.co.uk/2011/08/02/apple_dumps_mysql_from_mac_os_x_serv... Mac OS X Lion Server does not include MySQL anymore]. And of course Mac OS X client has never included MySQL. So I don't see how you're going to be able to migrate a Snow Leopard Server Apple MySQL setup to Lion Server anyway, without finding another way (like MacPorts) to install MySQL.
Lion includes MySQL for in-place upgrades from SL Server to Lion Server, but it is an older version. Erase installs of Lion Server do not have MySQL.
By "'claiming' /var/mysql" are you saying that MacPorts mysqld was creating its socket in that directory and keeping it open?
Yes
That should only have happened if MacPorts mysqld was started. And if you started MacPorts mysqld
I did not start it myself. It was started by launchd because I had the mysql5-server port installed (as part of install testing as mentioned above) but not configured.
that's a good indication that you're actually using it for something, and that perhaps Apple's migration script was right in not trying to interfere with it.
Unfortunately, I didn't realize that the launcdaemon was enabled by default as I never used it. -- Ticket URL: <https://trac.macports.org/ticket/30678#comment:13> MacPorts <http://www.macports.org/> Ports system for Mac OS
#30678: mysql5 should not read /etc/my.cnf -----------------------------------+---------------------------------------- Reporter: jeremyhu@… | Owner: ryandesign@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.1 Keywords: | Port: mysql5 -----------------------------------+---------------------------------------- Comment(by ryandesign@…): MacPorts launchd plists are not enabled by default; you have to explicitly start them by typing e.g. "sudo port load mysql5-server". -- Ticket URL: <https://trac.macports.org/ticket/30678#comment:14> MacPorts <http://www.macports.org/> Ports system for Mac OS
#30678: mysql5 should not read /etc/my.cnf ------------------------------------+--------------------------------------- Reporter: jeremyhu@… | Owner: ryandesign@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.0.1 Resolution: wontfix | Keywords: Port: mysql5 | ------------------------------------+--------------------------------------- Changes (by jeremyhu@…): * status: new => closed * resolution: => wontfix Comment: I think this should just be closed as behaves correct. -- Ticket URL: <https://trac.macports.org/ticket/30678#comment:15> MacPorts <http://www.macports.org/> Ports system for Mac OS
participants (1)
-
MacPorts