TritonDataCenter / pkgsrc

NetBSD/pkgsrc fork for our binary package repositories
https://pkgsrc.smartos.org/
131 stars 51 forks source link

MariaDB goes straight to maintenance after installing via pkgsrc #356

Closed brianewell closed 1 year ago

brianewell commented 1 year ago

TL;DR: It appears that mariadb-server is currently configured to expect a mariadb:mariadb writable directory at /var/run/mariadb. Unfortunately, manually creating one at that path doesn't survive a reboot.

Steps to reproduce:

  1. Use the latest available SmartOS virtual machine zone-dataset image (e44ed3e0-910b-11ed-a5d4-00151714048c)
  2. Install the latest available MariaDB server (mariadb-server-10.4.20nb9)
  3. Manually create a database (mysql_install_db --user=mariadb --basedir=/opt/local --datadir=/var/mysql) since that's apparently broken right now too.
  4. Note that attempts to start mariadb via svcs are met with maintenance states. Dig through the service log (/var/svc/log/pkgsrc-mariadb:default.log) and get nowhere, dig through the mariadb error log and notice permission errors on creating /var/run/mariadb.
  5. Create the directory, clear maintenance state on the service, rejoice.
  6. Restart the container, return to step 4.
brianewell commented 1 year ago

Do we actually even need a pid file if SMF is managing this process directly instead of wrapping it in a svc method script?

bahamat commented 1 year ago

This seems to be a duplicate of #346.

jperkin commented 1 year ago

Sorry, there are two issues here:

I'll get working on both.

jperkin commented 1 year ago

Ok I've fixed the builds of 10.5 and 10.6 packages in https://github.com/NetBSD/pkgsrc/commit/4033f2d9a1225061dc795daee239cc15090585ed and https://github.com/NetBSD/pkgsrc/commit/13b9b4ad37a3c8bab65edbb99b4fff85458c7182, and also fixed creating the initial databases on first run in https://github.com/NetBSD/pkgsrc/commit/76ca8fff37d3eaf1a485ea2a780b2e9991aa7d24

I'll get these backported to 2022Q4 and let you know when the packages are available.

jperkin commented 1 year ago

Ok the following packages are now available in 2022Q4:

$ pkgin se mariadb-server
mariadb-server-10.6.11  MariaDB 10.6, a free MySQL compatible database (server)
mariadb-server-10.5.18  MariaDB 10.5, a free MySQL compatible database (server)
mariadb-server-10.4.20nb9  MariaDB 10.4, a free MySQL compatible database (server)

I've tested them all to check they all correctly start up on a clean system using the following routine:

$ pkgin in 'mariadb-server>10.4<10.5'
$ /usr/sbin/svcadm enable -r svc:/pkgsrc/mariadb:default

..check for running service, test with "mysql -uroot"..

$ /usr/sbin/svcadm disable svc:/pkgsrc/mariadb:default
$ pkg_delete mariadb\*
$ /usr/sbin/svccfg delete svc:/pkgsrc/mariadb
$ rm -rf /var/mysql /var/log/mariadb

Repeat for:

$ pkgin in 'mariadb-server>10.5<10.6'
$ pkgin in 'mariadb-server>10.6'