--- /var/db/repos/gentoo/dev-db/mysql-init-scripts/files/init.d-2.3 2019-03-05 21:39:31.000000000 -0000 +++ /etc/init.d/mysql 2021-06-07 08:35:57.865509908 -0000 @@ -80,10 +80,12 @@ local chroot=$(get_config "${MY_CNF}" chroot | tail -n1) local wsrep="$(get_config "${MY_CNF}" 'wsrep[_-]on' | tail -n1 | awk '{print tolower($0)}')" local wsrep_new=$(get_config "${MY_CNF}" 'wsrep-new-cluster' | tail -n1) + local datadir=$(get_config "${MY_CNF}" datadir | tail -n1) if [ -n "${chroot}" ] ; then socket="${chroot}/${socket}" pidfile="${chroot}/${pidfile}" + datadir="${chroot}/${datadir}" fi # Galera: Only check datadir if not starting a new cluster and galera is enabled @@ -91,7 +93,6 @@ [ "${wsrep}" = "1" ] && wsrep="on" if [ "${wsrep}" != "on" ] || [ -n "${wsrep_new}" ] || stringContain 'wsrep-new-cluster' "${MY_ARGS}" ; then - local datadir=$(get_config "${MY_CNF}" datadir | tail -n1) if [ ! -d "${datadir}" ] ; then eerror "MySQL datadir \`${datadir}' is empty or invalid" eerror "Please check your config file \`${MY_CNF}'"