diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2020-05-30 11:44:06 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2020-05-30 11:44:06 +0100 |
commit | f516638b7fe9592837389826a6152a7e1b251c54 (patch) | |
tree | 8bfecb640b7b6403d7a3d662d923eed630033da7 /dev-db/mysql | |
parent | 1a61119f9f7b057830e2ce0563f913ec86f282ad (diff) |
gentoo resync : 30.05.2020
Diffstat (limited to 'dev-db/mysql')
-rw-r--r-- | dev-db/mysql/Manifest | 6 | ||||
-rw-r--r-- | dev-db/mysql/mysql-5.7.30.ebuild | 2 | ||||
-rw-r--r-- | dev-db/mysql/mysql-8.0.19-r1.ebuild | 183 | ||||
-rw-r--r-- | dev-db/mysql/mysql-8.0.20.ebuild | 185 |
4 files changed, 217 insertions, 159 deletions
diff --git a/dev-db/mysql/Manifest b/dev-db/mysql/Manifest index 47c89b13dce7..6c7b9c705ff1 100644 --- a/dev-db/mysql/Manifest +++ b/dev-db/mysql/Manifest @@ -18,7 +18,7 @@ DIST mysql-extras-20200317-0103Z.tar.bz2 344905 BLAKE2B c4c8bb2acea16663ab32cf29 EBUILD mysql-5.6.45-r2.ebuild 27033 BLAKE2B d1d7621c9b9535776e8acafa7a0a13923bfa19b28923a376769cb83f4d824913d192482efc8358549974ad454a036e480b695e584d45c90614ef82cb2682a3c0 SHA512 ba2d27d934f207fa9073946d650d0a709b491141f98410342d9491002cde51866126125b41356d86ba8387474f1a9c28ee6eff8d156e56828d3f67bbf10d6dd8 EBUILD mysql-5.7.27-r1.ebuild 31684 BLAKE2B 9ff6937c77124bc8b6a01f6b56f23941599a517b1d89519045ede1c67312c78e594ece5ad0a0ce3fa2b93594dc6eaf811a85867e1c6a29c4e931f6b1c7000429 SHA512 725c6023e23d8341cc474b29c5929d920795abaa2d7d0af995eacbd4d7f8fef20bf054226f3756960e1be7f45c87242f331aa70add9af3cd43501b7dc9189148 EBUILD mysql-5.7.29.ebuild 31420 BLAKE2B 7afa9f1af981304087cd0c1d6fbddf3031b1b0b9493e528acbc6befbf32432934a4920d6345a4ff18d3ea7973da0233d278f104295c75d232be3353960eb3922 SHA512 80a092af7eb3633973edf413ab07de355bc928648b7f42e89fc432e4143d3afcd34aec83f64329587ff4988a8d301006f43a32b1e3a2096c397e97be92b838e1 -EBUILD mysql-5.7.30.ebuild 30435 BLAKE2B facf1f861724cd3f97ffdf2a12d1338f05bad119d44014d39d76b659b4d113374175f0f9370f44e04e1cfa766ac765b0f059010c3cb74b08f9130e2bef5698a1 SHA512 1341a41fb5018c95e80f3d748c590a7159ab2bc1ab3896b1c9661b6c2598a665283170df3d584268647aa776ad0d4f810d74850bc99e37ed98c6d48d93050c9e -EBUILD mysql-8.0.19-r1.ebuild 36962 BLAKE2B e7f3d084bbc61e6ef205c136016d3ac46c5f82925a964eb04e4f2b1ea3c1748a86d40a02602a3ab5b49428ff213e98a28fac415987ce51d9329e4f984c820b03 SHA512 7c3628de6bf1fae99d6593e73b52203fba1d4482048c076d798755cb1c66197d5d0c921539252cc10fc733925b2c8dbd349039a5b1b295b4ebbf1147bcc1c360 -EBUILD mysql-8.0.20.ebuild 36231 BLAKE2B 2dbaecd485842582e4d680815d92b90666fea0193e33de1c7d55c278f009cc1d5dd13715ccc65a7052ff9fced379b55e6c4033cbb3663f48ff4c16c0ddb1f1c9 SHA512 c2d30efd25f86a11f7df8723293e639cd5673e9c3f0d974facacedf4bd09d0b9b3b3c92c7fc3791c2631559a9efdff265b23391e9a12d0e0671ad4495d1daeac +EBUILD mysql-5.7.30.ebuild 30434 BLAKE2B 054987d9bf5e8f13c88e177e49a6d923cc3f0b66b0a0036a22e26545a2e8fa1bba8be56e4e3219b7380db1a72dfdc4dd36bea1aa076c17addb0109bacc929440 SHA512 2027f3640624607c99e7791120309c622506239c8b2cfa85e01d50da482bda5fe7db00068dacf314cfaa54fb3b871ffd7bd276a249191b903c34d00fae3f3e7a +EBUILD mysql-8.0.19-r1.ebuild 37911 BLAKE2B 90a40972a8cd9de954aa6c89ceb81276f68f541809ba4d0484043878163ae0ccce7144cec51a262b84a2a7bd9cd53c50f7fac48abac5cf006d01a40bb5918563 SHA512 07bdddbb4b82eed2b383c2eae03cbe1e58c06a3bdc1b595703d6e32c839d17d34e8b1c8d4d2a7c4bdde2c6a04992fe8ad4758a3124d8b432dc2c2f23048a9d17 +EBUILD mysql-8.0.20.ebuild 37179 BLAKE2B 023e2f80e351cc3ea2daf0350783e05afdd59bd655f54b57b50d30e5acd3218e430ca404b7d4eb7e70c1f800ebacc65f183a344838a5441788a54a9a04521b56 SHA512 f5c03367c7ccb1b6c5acb42a3c344d8bf7f07d4f559b7fcda6dee78b5cd932b902cbccb9d335e9b6caa5c2a6b5091c176e4148bfc283839207ae8f63975f2079 MISC metadata.xml 1470 BLAKE2B 09754bc9a1cf5584588c4f69700919fd72a860175ae1c045ce90a644a1360d5abccedd5b2649e16fcd189e82df659ceb96fd71ab2aeccdac6256af4f80e46a0d SHA512 d96f6a133611f50b80116221e2586eff899210255efac58d9f6ef7ccd0ee0854a3322b4d4d1db15b3b2e410525f5d73e43f52a833f3ce358f6708b88b3cf00c7 diff --git a/dev-db/mysql/mysql-5.7.30.ebuild b/dev-db/mysql/mysql-5.7.30.ebuild index fab0a6937cb6..4543221a9e40 100644 --- a/dev-db/mysql/mysql-5.7.30.ebuild +++ b/dev-db/mysql/mysql-5.7.30.ebuild @@ -30,7 +30,7 @@ RESTRICT="!test? ( test ) libressl? ( test )" REQUIRED_USE="?? ( tcmalloc jemalloc )" -KEYWORDS="amd64 arm arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris" +KEYWORDS="amd64 arm arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris" # Shorten the path because the socket path length must be shorter than 107 chars # and we will run a mysql server during test phase diff --git a/dev-db/mysql/mysql-8.0.19-r1.ebuild b/dev-db/mysql/mysql-8.0.19-r1.ebuild index 404aa98a36e3..827c57daf940 100644 --- a/dev-db/mysql/mysql-8.0.19-r1.ebuild +++ b/dev-db/mysql/mysql-8.0.19-r1.ebuild @@ -576,43 +576,6 @@ pkg_postinst() { } pkg_config() { - local mysqld_binary="${EROOT}/usr/sbin/mysqld" - if [[ ! -x "${mysqld_binary}" ]] ; then - die "'${mysqld_binary}' not found! Please re-install ${CATEGORY}/${PN}!" - fi - - local mysql_binary="${EROOT}/usr/bin/mysql" - if [[ ! -x "${mysql_binary}" ]] ; then - die "'${mysql_binary}' not found! Please re-install ${CATEGORY}/${PN}!" - fi - - local my_print_defaults_binary="${EROOT}/usr/bin/my_print_defaults" - if [[ ! -x "${my_print_defaults_binary}" ]] ; then - die "'${my_print_defaults_binary}' not found! Please re-install dev-db/mysql-connector-c!" - fi - - if [[ -z "${MYSQL_USER}" ]] ; then - MYSQL_USER=mysql - if use prefix ; then - MYSQL_USER=$(id -u -n 2>/dev/null) - if [[ -z "${MYSQL_USER}" ]] ; then - die "Failed to determine current username!" - fi - fi - fi - - if [[ -z "${MYSQL_GROUP}" ]] ; then - MYSQL_GROUP=mysql - if use prefix ; then - MYSQL_GROUP=$(id -g -n 2>/dev/null) - if [[ -z "${MYSQL_GROUP}" ]] ; then - die "Failed to determine current user groupname!" - fi - fi - fi - - einfo "Will use username '${MYSQL_USER}' and group '${MYSQL_GROUP}' ..." - _getoptval() { local section="$1" local flag="--${2}=" @@ -677,6 +640,41 @@ pkg_config() { done } + local mysqld_binary="${EROOT}/usr/sbin/mysqld" + if [[ ! -x "${mysqld_binary}" ]] ; then + die "'${mysqld_binary}' not found! Please re-install ${CATEGORY}/${PN}!" + fi + + local mysql_binary="${EROOT}/usr/bin/mysql" + if [[ ! -x "${mysql_binary}" ]] ; then + die "'${mysql_binary}' not found! Please re-install ${CATEGORY}/${PN}!" + fi + + local my_print_defaults_binary="${EROOT}/usr/bin/my_print_defaults" + if [[ ! -x "${my_print_defaults_binary}" ]] ; then + die "'${my_print_defaults_binary}' not found! Please re-install dev-db/mysql-connector-c!" + fi + + if [[ -z "${MYSQL_USER}" ]] ; then + MYSQL_USER=mysql + if use prefix ; then + MYSQL_USER=$(id -u -n 2>/dev/null) + if [[ -z "${MYSQL_USER}" ]] ; then + die "Failed to determine current username!" + fi + fi + fi + + if [[ -z "${MYSQL_GROUP}" ]] ; then + MYSQL_GROUP=mysql + if use prefix ; then + MYSQL_GROUP=$(id -g -n 2>/dev/null) + if [[ -z "${MYSQL_GROUP}" ]] ; then + die "Failed to determine current user groupname!" + fi + fi + fi + # my_print_defaults needs to read stuff in $HOME/.my.cnf local -x HOME="${EROOT}/root" @@ -696,8 +694,6 @@ pkg_config() { ewarn "Looks like your data directory '${MY_DATADIR}' is already initialized!" ewarn "Please rename or delete its content if you wish to initialize a new data directory." die "${PN} data directory at '${MY_DATADIR}' looks already initialized!" - else - einfo "${PN} data directory detected as '${MY_DATADIR}' ..." fi MYSQL_TMPDIR="$(_getoptval mysqld tmpdir "--defaults-file='${MY_SYSCONFDIR}/my.cnf'")" @@ -751,7 +747,7 @@ pkg_config() { su -s /bin/sh -c "touch ${_my_datadir_testfile}" ${MYSQL_USER} &>/dev/null fi - if [[ $? -ne 0 ]]; then + if [[ $? -ne 0 ]] ; then die "${MYSQL_USER} user cannot write into data directory '${MY_DATADIR}'!" else rm "${_my_datadir_testfile}" || die @@ -764,28 +760,8 @@ pkg_config() { || die "Failed to create ${PN} tmpdir '${MYSQL_TMPDIR}'!" fi - if [[ -n "${MYSQL_TMPDIR}" ]] ; then - local _my_tmpdir_testfile="$(_mktemp_dry "${MYSQL_TMPDIR}/.pkg_config-access-test.XXXXXXXXX")" - [[ -z "${_my_tmpdir_testfile}" ]] \ - && die "_mktemp_dry() for '${MYSQL_TMPDIR}/.pkg_config-access-test.XXXXXXXXX' failed!" - - if use prefix ; then - touch "${_my_tmpdir_testfile}" &>/dev/null - else - su -s /bin/sh -c "touch ${_my_tmpdir_testfile}" ${MYSQL_USER} &>/dev/null - fi - - if [[ $? -ne 0 ]]; then - die "${MYSQL_USER} user cannot write into data directory '${MYSQL_TMPDIR}'!" - else - rm "${_my_tmpdir_testfile}" || die - unset _my_tmpdir_testfile - fi - else - # If no tmpdir is set, mysqld will use default system tmpdir. - # However, we are using tmpdir from package manager at the - # moment which maybe isn't writeable for $MYSQL_USER... - MYSQL_TMPDIR="$(_mktemp_dry "${T}/mysqld-tmp.XXXXXXXXX")" + if [[ -z "${MYSQL_TMPDIR}" ]] ; then + MYSQL_TMPDIR="$(_mktemp_dry "${EROOT}/tmp/mysqld-tmp.XXXXXXXXX")" [[ -z "${MYSQL_TMPDIR}" ]] \ && die "_mktemp_dry() for '${MYSQL_TMPDIR}' failed!" @@ -793,6 +769,24 @@ pkg_config() { chown ${MYSQL_USER} "${MYSQL_TMPDIR}" || die fi + # Now we need to test MYSQL_TMPDIR... + local _my_tmpdir_testfile="$(_mktemp_dry "${MYSQL_TMPDIR}/.pkg_config-access-test.XXXXXXXXX")" + [[ -z "${_my_tmpdir_testfile}" ]] \ + && die "_mktemp_dry() for '${MYSQL_TMPDIR}/.pkg_config-access-test.XXXXXXXXX' failed!" + + if use prefix ; then + touch "${_my_tmpdir_testfile}" &>/dev/null + else + su -s /bin/sh -c "touch ${_my_tmpdir_testfile}" ${MYSQL_USER} &>/dev/null + fi + + if [[ $? -ne 0 ]] ; then + die "${MYSQL_USER} user cannot write into tmpdir '${MYSQL_TMPDIR}'!" + else + rm "${_my_tmpdir_testfile}" || die + unset _my_tmpdir_testfile + fi + if [[ -n "${MYSQL_LOG_BIN}" && ! -d "${MYSQL_LOG_BIN}" ]] ; then einfo "Creating ${PN} log-bin directory '${MYSQL_LOG_BIN}' ..." install -d -m 770 -o ${MYSQL_USER} -g ${MYSQL_GROUP} "${MYSQL_LOG_BIN}" \ @@ -810,7 +804,7 @@ pkg_config() { su -s /bin/sh -c "touch ${_my_logbin_testfile}" ${MYSQL_USER} &>/dev/null fi - if [[ $? -ne 0 ]]; then + if [[ $? -ne 0 ]] ; then die "${MYSQL_USER} user cannot write into log-bin directory '${MYSQL_LOG_BIN}'!" else rm "${_my_logbin_testfile}" || die @@ -835,7 +829,7 @@ pkg_config() { su -s /bin/sh -c "touch ${_my_relaylog_testfile}" ${MYSQL_USER} &>/dev/null fi - if [[ $? -ne 0 ]]; then + if [[ $? -ne 0 ]] ; then die "${MYSQL_USER} user cannot write into relay-log directory '${MYSQL_RELAY_LOG}'!" else rm "${_my_relaylog_testfile}" || die @@ -843,6 +837,44 @@ pkg_config() { fi fi + local mysql_install_log="$(_mktemp_dry "${MYSQL_TMPDIR}/install_db.XXXXXXXXX.log")" + if [[ -z "${mysql_install_log}" ]] ; then + die "_mktemp_dry() for '${MYSQL_TMPDIR}/install_db.XXXXXXXXX.log' failed!" + else + # make sure file is writable for MYSQL_USER... + touch "${mysql_install_log}" || die + chown ${MYSQL_USER} "${mysql_install_log}" || die + fi + + local mysqld_logfile="$(_mktemp_dry "${MYSQL_TMPDIR}/install_mysqld.XXXXXXXXX.log")" + if [[ -z "${mysqld_logfile}" ]] ; then + die "_mktemp_dry() for '${MYSQL_TMPDIR}/install_mysqld.XXXXXXXXX.log' failed!" + else + # make sure file is writable for MYSQL_USER... + touch "${mysqld_logfile}" || die + chown ${MYSQL_USER} "${mysqld_logfile}" || die + fi + + echo "" + einfo "Detected settings:" + einfo "==================" + einfo "MySQL User:\t\t\t\t${MYSQL_USER}" + einfo "MySQL Group:\t\t\t\t${MYSQL_GROUP}" + einfo "MySQL DATA directory:\t\t${MY_DATADIR}" + einfo "MySQL TMP directory:\t\t\t${MYSQL_TMPDIR}" + + if [[ -n "${MYSQL_LOG_BIN}" ]] ; then + einfo "MySQL Binary Log File location:\t${MYSQL_LOG_BIN}" + fi + + if [[ -n "${MYSQL_RELAY_LOG}" ]] ; then + einfo "MySQL Relay Log File location:\t${MYSQL_RELAY_LOG}" + fi + + einfo "PID DIR:\t\t\t\t${PID_DIR}" + einfo "Install db log:\t\t\t${mysql_install_log}" + einfo "Install server log:\t\t\t${mysqld_logfile}" + local -a config_files local config_file="${EROOT}/etc/mysql/mysql.d/50-distro-client.cnf" @@ -888,6 +920,8 @@ pkg_config() { ;; esac + echo "Selected authentication plugin: ${MYSQL_DEFAULT_AUTHENTICATION_PLUGIN}" >> "${mysql_install_log}" + unset user_answer fi @@ -993,19 +1027,16 @@ pkg_config() { # Prepare timezones, see # https://dev.mysql.com/doc/mysql/en/time-zone-support.html - local tz_sql="${TMPDIR}/tz.sql" + local tz_sql="$(_mktemp_dry "${MYSQL_TMPDIR}/tz.XXXXXXXXX.sql")" + [[ -z "${tz_sql}" ]] \ + && die "_mktemp_dry() for '${MYSQL_TMPDIR}/tz.XXXXXXXXX.sql' failed!" + echo "USE mysql;" >"${tz_sql}" "${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" >> "${tz_sql}" 2>/dev/null if [[ $? -ne 0 ]] ; then die "mysql_tzinfo_to_sql failed!" fi - chown ${MYSQL_USER} "${tz_sql}" || die - - local mysql_install_log="${TMPDIR}/mysql_install_db.log" - touch "${mysql_install_log}" || die - chown ${MYSQL_USER} "${mysql_install_log}" || die - # --initialize-insecure will not set root password # --initialize would set a random one in the log which we don't need as we set it ourselves local cmd=( @@ -1028,15 +1059,13 @@ pkg_config() { die "Failed to initialize ${PN} data directory. Please review '${mysql_install_log}'!" fi + rm "${tz_sql}" || die + local x=${RANDOM} - local socket="${EROOT}/run/mysqld/mysqld${x}.sock" - local pidfile="${EROOT}/run/mysqld/mysqld${x}.pid" + local socket="${EROOT}${PID_DIR}/mysqld${x}.sock" + local pidfile="${EROOT}${PID_DIR}/mysqld${x}.pid" unset x - local mysqld_logfile="${TMPDIR}/mysqld.log" - touch "${mysqld_logfile}" || die - chown ${MYSQL_USER} "${mysqld_logfile}" || die - cmd=( "${mysqld_binary}" "${mysqld_options[@]}" diff --git a/dev-db/mysql/mysql-8.0.20.ebuild b/dev-db/mysql/mysql-8.0.20.ebuild index 7a1ea0b39205..055853424359 100644 --- a/dev-db/mysql/mysql-8.0.20.ebuild +++ b/dev-db/mysql/mysql-8.0.20.ebuild @@ -37,7 +37,7 @@ REQUIRED_USE="?? ( tcmalloc jemalloc ) router? ( server ) tcmalloc? ( server )" -KEYWORDS="amd64 arm arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris" +KEYWORDS="amd64 arm arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris" # Shorten the path because the socket path length must be shorter than 107 chars # and we will run a mysql server during test phase @@ -558,43 +558,6 @@ pkg_postinst() { } pkg_config() { - local mysqld_binary="${EROOT}/usr/sbin/mysqld" - if [[ ! -x "${mysqld_binary}" ]] ; then - die "'${mysqld_binary}' not found! Please re-install ${CATEGORY}/${PN}!" - fi - - local mysql_binary="${EROOT}/usr/bin/mysql" - if [[ ! -x "${mysql_binary}" ]] ; then - die "'${mysql_binary}' not found! Please re-install ${CATEGORY}/${PN}!" - fi - - local my_print_defaults_binary="${EROOT}/usr/bin/my_print_defaults" - if [[ ! -x "${my_print_defaults_binary}" ]] ; then - die "'${my_print_defaults_binary}' not found! Please re-install dev-db/mysql-connector-c!" - fi - - if [[ -z "${MYSQL_USER}" ]] ; then - MYSQL_USER=mysql - if use prefix ; then - MYSQL_USER=$(id -u -n 2>/dev/null) - if [[ -z "${MYSQL_USER}" ]] ; then - die "Failed to determine current username!" - fi - fi - fi - - if [[ -z "${MYSQL_GROUP}" ]] ; then - MYSQL_GROUP=mysql - if use prefix ; then - MYSQL_GROUP=$(id -g -n 2>/dev/null) - if [[ -z "${MYSQL_GROUP}" ]] ; then - die "Failed to determine current user groupname!" - fi - fi - fi - - einfo "Will use username '${MYSQL_USER}' and group '${MYSQL_GROUP}' ..." - _getoptval() { local section="$1" local flag="--${2}=" @@ -659,6 +622,41 @@ pkg_config() { done } + local mysqld_binary="${EROOT}/usr/sbin/mysqld" + if [[ ! -x "${mysqld_binary}" ]] ; then + die "'${mysqld_binary}' not found! Please re-install ${CATEGORY}/${PN}!" + fi + + local mysql_binary="${EROOT}/usr/bin/mysql" + if [[ ! -x "${mysql_binary}" ]] ; then + die "'${mysql_binary}' not found! Please re-install ${CATEGORY}/${PN}!" + fi + + local my_print_defaults_binary="${EROOT}/usr/bin/my_print_defaults" + if [[ ! -x "${my_print_defaults_binary}" ]] ; then + die "'${my_print_defaults_binary}' not found! Please re-install dev-db/mysql-connector-c!" + fi + + if [[ -z "${MYSQL_USER}" ]] ; then + MYSQL_USER=mysql + if use prefix ; then + MYSQL_USER=$(id -u -n 2>/dev/null) + if [[ -z "${MYSQL_USER}" ]] ; then + die "Failed to determine current username!" + fi + fi + fi + + if [[ -z "${MYSQL_GROUP}" ]] ; then + MYSQL_GROUP=mysql + if use prefix ; then + MYSQL_GROUP=$(id -g -n 2>/dev/null) + if [[ -z "${MYSQL_GROUP}" ]] ; then + die "Failed to determine current user groupname!" + fi + fi + fi + # my_print_defaults needs to read stuff in $HOME/.my.cnf local -x HOME="${EROOT}/root" @@ -678,8 +676,6 @@ pkg_config() { ewarn "Looks like your data directory '${MY_DATADIR}' is already initialized!" ewarn "Please rename or delete its content if you wish to initialize a new data directory." die "${PN} data directory at '${MY_DATADIR}' looks already initialized!" - else - einfo "${PN} data directory detected as '${MY_DATADIR}' ..." fi MYSQL_TMPDIR="$(_getoptval mysqld tmpdir "--defaults-file='${MY_SYSCONFDIR}/my.cnf'")" @@ -733,7 +729,7 @@ pkg_config() { su -s /bin/sh -c "touch ${_my_datadir_testfile}" ${MYSQL_USER} &>/dev/null fi - if [[ $? -ne 0 ]]; then + if [[ $? -ne 0 ]] ; then die "${MYSQL_USER} user cannot write into data directory '${MY_DATADIR}'!" else rm "${_my_datadir_testfile}" || die @@ -746,28 +742,8 @@ pkg_config() { || die "Failed to create ${PN} tmpdir '${MYSQL_TMPDIR}'!" fi - if [[ -n "${MYSQL_TMPDIR}" ]] ; then - local _my_tmpdir_testfile="$(_mktemp_dry "${MYSQL_TMPDIR}/.pkg_config-access-test.XXXXXXXXX")" - [[ -z "${_my_tmpdir_testfile}" ]] \ - && die "_mktemp_dry() for '${MYSQL_TMPDIR}/.pkg_config-access-test.XXXXXXXXX' failed!" - - if use prefix ; then - touch "${_my_tmpdir_testfile}" &>/dev/null - else - su -s /bin/sh -c "touch ${_my_tmpdir_testfile}" ${MYSQL_USER} &>/dev/null - fi - - if [[ $? -ne 0 ]]; then - die "${MYSQL_USER} user cannot write into data directory '${MYSQL_TMPDIR}'!" - else - rm "${_my_tmpdir_testfile}" || die - unset _my_tmpdir_testfile - fi - else - # If no tmpdir is set, mysqld will use default system tmpdir. - # However, we are using tmpdir from package manager at the - # moment which maybe isn't writeable for $MYSQL_USER... - MYSQL_TMPDIR="$(_mktemp_dry "${T}/mysqld-tmp.XXXXXXXXX")" + if [[ -z "${MYSQL_TMPDIR}" ]] ; then + MYSQL_TMPDIR="$(_mktemp_dry "${EROOT}/tmp/mysqld-tmp.XXXXXXXXX")" [[ -z "${MYSQL_TMPDIR}" ]] \ && die "_mktemp_dry() for '${MYSQL_TMPDIR}' failed!" @@ -775,6 +751,24 @@ pkg_config() { chown ${MYSQL_USER} "${MYSQL_TMPDIR}" || die fi + # Now we need to test MYSQL_TMPDIR... + local _my_tmpdir_testfile="$(_mktemp_dry "${MYSQL_TMPDIR}/.pkg_config-access-test.XXXXXXXXX")" + [[ -z "${_my_tmpdir_testfile}" ]] \ + && die "_mktemp_dry() for '${MYSQL_TMPDIR}/.pkg_config-access-test.XXXXXXXXX' failed!" + + if use prefix ; then + touch "${_my_tmpdir_testfile}" &>/dev/null + else + su -s /bin/sh -c "touch ${_my_tmpdir_testfile}" ${MYSQL_USER} &>/dev/null + fi + + if [[ $? -ne 0 ]] ; then + die "${MYSQL_USER} user cannot write into tmpdir '${MYSQL_TMPDIR}'!" + else + rm "${_my_tmpdir_testfile}" || die + unset _my_tmpdir_testfile + fi + if [[ -n "${MYSQL_LOG_BIN}" && ! -d "${MYSQL_LOG_BIN}" ]] ; then einfo "Creating ${PN} log-bin directory '${MYSQL_LOG_BIN}' ..." install -d -m 770 -o ${MYSQL_USER} -g ${MYSQL_GROUP} "${MYSQL_LOG_BIN}" \ @@ -792,7 +786,7 @@ pkg_config() { su -s /bin/sh -c "touch ${_my_logbin_testfile}" ${MYSQL_USER} &>/dev/null fi - if [[ $? -ne 0 ]]; then + if [[ $? -ne 0 ]] ; then die "${MYSQL_USER} user cannot write into log-bin directory '${MYSQL_LOG_BIN}'!" else rm "${_my_logbin_testfile}" || die @@ -817,7 +811,7 @@ pkg_config() { su -s /bin/sh -c "touch ${_my_relaylog_testfile}" ${MYSQL_USER} &>/dev/null fi - if [[ $? -ne 0 ]]; then + if [[ $? -ne 0 ]] ; then die "${MYSQL_USER} user cannot write into relay-log directory '${MYSQL_RELAY_LOG}'!" else rm "${_my_relaylog_testfile}" || die @@ -825,6 +819,44 @@ pkg_config() { fi fi + local mysql_install_log="$(_mktemp_dry "${MYSQL_TMPDIR}/install_db.XXXXXXXXX.log")" + if [[ -z "${mysql_install_log}" ]] ; then + die "_mktemp_dry() for '${MYSQL_TMPDIR}/install_db.XXXXXXXXX.log' failed!" + else + # make sure file is writable for MYSQL_USER... + touch "${mysql_install_log}" || die + chown ${MYSQL_USER} "${mysql_install_log}" || die + fi + + local mysqld_logfile="$(_mktemp_dry "${MYSQL_TMPDIR}/install_mysqld.XXXXXXXXX.log")" + if [[ -z "${mysqld_logfile}" ]] ; then + die "_mktemp_dry() for '${MYSQL_TMPDIR}/install_mysqld.XXXXXXXXX.log' failed!" + else + # make sure file is writable for MYSQL_USER... + touch "${mysqld_logfile}" || die + chown ${MYSQL_USER} "${mysqld_logfile}" || die + fi + + echo "" + einfo "Detected settings:" + einfo "==================" + einfo "MySQL User:\t\t\t\t${MYSQL_USER}" + einfo "MySQL Group:\t\t\t\t${MYSQL_GROUP}" + einfo "MySQL DATA directory:\t\t${MY_DATADIR}" + einfo "MySQL TMP directory:\t\t\t${MYSQL_TMPDIR}" + + if [[ -n "${MYSQL_LOG_BIN}" ]] ; then + einfo "MySQL Binary Log File location:\t${MYSQL_LOG_BIN}" + fi + + if [[ -n "${MYSQL_RELAY_LOG}" ]] ; then + einfo "MySQL Relay Log File location:\t${MYSQL_RELAY_LOG}" + fi + + einfo "PID DIR:\t\t\t\t${PID_DIR}" + einfo "Install db log:\t\t\t${mysql_install_log}" + einfo "Install server log:\t\t\t${mysqld_logfile}" + local -a config_files local config_file="${EROOT}/etc/mysql/mysql.d/50-distro-client.cnf" @@ -870,6 +902,8 @@ pkg_config() { ;; esac + echo "Selected authentication plugin: ${MYSQL_DEFAULT_AUTHENTICATION_PLUGIN}" >> "${mysql_install_log}" + unset user_answer fi @@ -975,19 +1009,16 @@ pkg_config() { # Prepare timezones, see # https://dev.mysql.com/doc/mysql/en/time-zone-support.html - local tz_sql="${TMPDIR}/tz.sql" + local tz_sql="$(_mktemp_dry "${MYSQL_TMPDIR}/tz.XXXXXXXXX.sql")" + [[ -z "${tz_sql}" ]] \ + && die "_mktemp_dry() for '${MYSQL_TMPDIR}/tz.XXXXXXXXX.sql' failed!" + echo "USE mysql;" >"${tz_sql}" "${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" >> "${tz_sql}" 2>/dev/null if [[ $? -ne 0 ]] ; then die "mysql_tzinfo_to_sql failed!" fi - chown ${MYSQL_USER} "${tz_sql}" || die - - local mysql_install_log="${TMPDIR}/mysql_install_db.log" - touch "${mysql_install_log}" || die - chown ${MYSQL_USER} "${mysql_install_log}" || die - # --initialize-insecure will not set root password # --initialize would set a random one in the log which we don't need as we set it ourselves local cmd=( @@ -1010,15 +1041,13 @@ pkg_config() { die "Failed to initialize ${PN} data directory. Please review '${mysql_install_log}'!" fi + rm "${tz_sql}" || die + local x=${RANDOM} - local socket="${EROOT}/run/mysqld/mysqld${x}.sock" - local pidfile="${EROOT}/run/mysqld/mysqld${x}.pid" + local socket="${EROOT}${PID_DIR}/mysqld${x}.sock" + local pidfile="${EROOT}${PID_DIR}/mysqld${x}.pid" unset x - local mysqld_logfile="${TMPDIR}/mysqld.log" - touch "${mysqld_logfile}" || die - chown ${MYSQL_USER} "${mysqld_logfile}" || die - cmd=( "${mysqld_binary}" "${mysqld_options[@]}" |