[MacPorts] #52144: mariadb: support for mpkg / mdmg
#52144: mariadb: support for mpkg / mdmg --------------------------+---------------------------- Reporter: ctreleaven@… | Owner: pixilla Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Keywords: | Port: mariadb-server --------------------------+---------------------------- My mythtv ports rely on mariadb as the backend database. This ticket proposes some enhancements to mariadb to better support packaging via an mpkg or mdmg. First, mariadb (5.5) still uses an antiquated startupitem which in turn relies on daemondo. I believe the new launchd (10.10 and later?) no longer supports startupitems. In any event, it is a problem to include daemondo in a pkg. Therefore, I've adapted the launchd plist introduced in MySQL 5.7.8 to work with mariadb in the MacPorts environment. Patch attached for review and comments. Second, I'm developing packaging scripts (preinstall, postflight, etc) such that manual intervention will not be required after an mpkg / mdmg installation. The database will be functional and running. This is different than the state after 'sudo port install mariadb-server' but I think it makes sense. Most users installing from an mpkg don't expect to have to do manual steps afterwards to have functional software. A patch is in process for this and will hopefully be submitted in a few days. -- Ticket URL: <https://trac.macports.org/ticket/52144> MacPorts <https://www.macports.org/> Ports system for OS X
#52144: mariadb: support for mpkg / mdmg -----------------------------+--------------------- Reporter: ctreleaven@… | Owner: pixilla Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: mariadb-server | -----------------------------+--------------------- Comment (by ctreleaven@…): BTW, the MySQL launchd plist that I started with [1] contains some unfamiliar keys: {{{ + <key>ProcessType</key> <string>Interactive</string> + <key>SessionCreate</key> <true/> }}} I don't have an easy way to test this with older Mac OS X versions (pre 10.9). Could someone confirm whether they cause a problem in such an environment? I believe neither key is strictly necessary for our mariadb-server implementation and they could easily be removed if they present a problem. [1] https://docs.oracle.com/cd/E17952_01/mysql-5.6-en/osx-installation- launchd.html -- Ticket URL: <https://trac.macports.org/ticket/52144#comment:1> MacPorts <https://www.macports.org/> Ports system for OS X
#52144: mariadb: support for mpkg / mdmg -----------------------------+----------------------- Reporter: ctreleaven@… | Owner: pixilla@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: Port: mariadb-server | -----------------------------+----------------------- Changes (by mf2k@…): * owner: pixilla => pixilla@… * version: 2.3.4 => Comment: Trac requires complete email addresses. -- Ticket URL: <https://trac.macports.org/ticket/52144#comment:2> MacPorts <https://www.macports.org/> Ports system for OS X
#52144: mariadb: support for mpkg / mdmg -----------------------------+----------------------- Reporter: ctreleaven@… | Owner: pixilla@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: Port: mariadb-server | -----------------------------+----------------------- Comment (by ctreleaven@…): Attached is a new patch that adds packaging support as well as a couple of small tweaks to my previous patch. At over 150 lines, I know it is a lot to take in but it breaks down into logical groups. As in the previous patch, there are sections to copy the launchd plist out of ${filespath} and update the ${prefix} and port name. Then there are post-activate and pre-deactivate blocks to link/unlink the plist into /Library/LaunchDaemons. Then 29 lines for the plist itself. Now added is a pre-pkg block. This copies the two scripts (preinstall and postinstall) from ${filespath} and fixes the @NAME@ and @PREFIX@ placeholders. Also, ensures that the scripts have 0755 permissions. The preinstall script uses 'launchctl list' to check if the deamon is supposed to be running. If so, it unloads it. The postinstall script: - forces the launchd plist to 0644 permissions. I don't think the _should_ be necessary but sometimes had problems during testing. Easier just to use a sledgehammer and force it. - remove the old link in /Library/LaunchDaemons (if one is there) and put in the new one - force the right user/group on our directories in var/run, var/db and var/log. - run the upstream database initialization script, mysql_install_db. - again checks for a loaded daemon and unloads it if it is. Again ought to be unnecessary but harmless if the preinstall script did its job. - finally, use launchctl to load the daemon. The command line arguments in the launchd plist should bring up a minimally configured db server. Subsequently, the user (or another installer) can add a my.cnf configuration file to customize as desired. In addition, I made a gratuitous change to the long_description. (Wording is a mash-up from the MariaDB About page.) This description appears on the Installer splash screen after packaging and seems a little more descriptive of what the user is about to inflict on their system. Barring objections, I plan commit these changes under openmaintainer in the next few days. I feel the startupitem to launchd plist changes are relatively low risk. I'll try to handle anything that might crop up. My packaging-related changes only have any effect if one is creating an mpkg or mdmg. My impression is that there are very few people doing that --it would not work now because of the daemondo problem. -- Ticket URL: <https://trac.macports.org/ticket/52144#comment:3> MacPorts <https://www.macports.org/> Ports system for macOS
#52144: mariadb: support for mpkg / mdmg -----------------------------+----------------------- Reporter: ctreleaven@… | Owner: pixilla@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: Port: mariadb-server | -----------------------------+----------------------- Comment (by ctreleaven@…): Revised patch attached. Now respects the setting of startupitem.install. I confirm that the 'sudo port load | unload' function as expected. -- Ticket URL: <https://trac.macports.org/ticket/52144#comment:4> MacPorts <https://www.macports.org/> Ports system for macOS
#52144: mariadb: support for mpkg / mdmg -----------------------------+----------------------- Reporter: ctreleaven@… | Owner: pixilla@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: Port: mariadb-server | -----------------------------+----------------------- Comment (by mf2k@…): Note that {{{revision_server}}} should be 1 (not 4) in your patch. -- Ticket URL: <https://trac.macports.org/ticket/52144#comment:5> MacPorts <https://www.macports.org/> Ports system for macOS
#52144: mariadb: support for mpkg / mdmg -----------------------------+----------------------- Reporter: ctreleaven@… | Owner: pixilla@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: Port: mariadb-server | -----------------------------+----------------------- Comment (by ctreleaven@…): Revisions don't _have_ to go sequentially, do they? I'm using the intermediate revisions internally for A-B comparison. Unfortunately, I have a new patch. Even though the installer was reporting success, part of one script was failing. The installer runs the pre|postinstall scripts inside a sandbox that does not have access to /Private, among other things. Thus, no access to /tmp. This caused mysql_install_db to stumble. Fixed that by telling it to use the datadir for temp files. Sorry that I didn't catch this earlier. -- Ticket URL: <https://trac.macports.org/ticket/52144#comment:6> MacPorts <https://www.macports.org/> Ports system for macOS
#52144: mariadb: support for mpkg / mdmg -----------------------------+----------------------- Reporter: ctreleaven@… | Owner: pixilla@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: Port: mariadb-server | -----------------------------+----------------------- Comment (by pixilla@…): As discussed in direct email with ctreleaven these patches need more testing before committing. I should have a commit ready later this week or next. -- Ticket URL: <https://trac.macports.org/ticket/52144#comment:7> MacPorts <https://www.macports.org/> Ports system for macOS
#52144: mariadb: support for mpkg / mdmg -----------------------------+----------------------- Reporter: ctreleaven@… | Owner: pixilla@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: Port: mariadb-server | -----------------------------+----------------------- Comment (by pixilla@…): Partially resolved in r153724. -- Ticket URL: <https://trac.macports.org/ticket/52144#comment:8> MacPorts <https://www.macports.org/> Ports system for the Mac operating system
participants (1)
-
MacPorts