If you install dev-db/mariadb-5.5.32 and attempt to start it without running --config first you get the following misleading message: # /etc/init.d/mysql start * Starting mysql ... * You don't appear to have the mysql database installed yet. * Please run /usr/bin/mysql_install_db to have this done... * ERROR: mysql failed to start The file /usr/bin/mysql_install_db does not exist. # /usr/bin/mysql_install_db -su: /usr/bin/mysql_install_db: No such file or directory The error message should be updated asking the user to run emerge --config dev-db/mariadb instead. Reproducible: Always Steps to Reproduce: 1. emerge mariadb 2. /etc/init.d/mariadb start 3. Actual Results: # /etc/init.d/mysql start * Starting mysql ... * You don't appear to have the mysql database installed yet. * Please run /usr/bin/mysql_install_db to have this done... * ERROR: mysql failed to start
This is a known "issue" and the mariadb / mysql packages do emit a warning about running "emerge --config" on a new install. * You might want to run: * "emerge --config =dev-db/mariadb-5.5.32" * if this is a new install.
I came up with this small patch. Comments welcome from the team. --- a/mysql-5.1.67-init.d 2013-01-17 20:51:47.000000000 -0500 +++ b/mysql-5.1.67-init.d 2014-05-14 14:08:50.958527172 -0400 @@ -59,8 +59,20 @@ fi if [ ! -d "${datadir}"/mysql ] ; then - eerror "You don't appear to have the mysql database installed yet." - eerror "Please run /usr/bin/mysql_install_db to have this done..." + # find which package is installed to report an error + local EROOT=$(portageq envvar EROOT) + local DBPKG_P="" + # This order follows the virtual for shortest path + for pkg in dev-db/mariadb dev-db/mysql dev-db/percona-server dev-db/mariadb-galera dev-db/mysql-cluster ; do + DBPKG_P=$(portageq best_version ${EROOT} ${pkg}) + [[ -n ${DBPKG_P} ]] && break + done + if [[ -z ${DBPKG_P} ]] ; then + eerror "You don't appear to have a server package installed yet." + else + eerror "You don't appear to have the mysql database installed yet." + eerror "Please run \`emerge --config =${DBPKG_P}\` to have this done..." + fi return 1 fi
Created attachment 377010 [details, diff] mysql-5.1.67-init.d.patch This seems better as it does not rely on an arbitrary list and expands the virtual instead
*mysql-init-scripts-2.0_pre1-r7 (16 May 2014) 16 May 2014; Brian Evans <grknight@gentoo.org> +files/mysql-5.1.67-init.d-r1, +mysql-init-scripts-2.0_pre1-r7.ebuild, -files/mysql-5.1.53-init.d, -mysql-init-scripts-2.0_pre1-r2.ebuild, -mysql-init-scripts-2.0_pre1-r3.ebuild: Revbump to fix bug 491348, remove old
*** Bug 523280 has been marked as a duplicate of this bug. ***