install_mysql.sh: add 'support /etc/alternatives/my.cnf'.

This commit is contained in:
Christoph 2020-08-13 15:14:42 +02:00
parent 44583b2d3c
commit f22d23c669

View File

@ -5140,28 +5140,59 @@ else
fi
echononl "Erstelle Symlink /etc/mysql/my.cnf --> ${MYSQL_INSTALL_DIR}/etc/my.cnf"
echononl "Add Path '$(dirname "${MYSQL_INSTALL_DIR}")/mysql/etc/my.cnf' for 'my.cnf' using 'update-alternatives'.."
if ! $PARALLEL_INSTALLATION ; then
echo "" >> ${logdir}/main.log
echo "## - Erstelle Symlink /etc/mysql/my.cnf --> ${MYSQL_INSTALL_DIR}/etc/my.cnf" >> ${logdir}/main.log
echo "## -" >> ${logdir}/main.log
echo "ln -s \"$(dirname "${MYSQL_INSTALL_DIR}")/mysql/etc/my.cnf\" \"/etc/mysql/\"" >> ${logdir}/main.log
ln -s "$(dirname "${MYSQL_INSTALL_DIR}")/mysql/etc/my.cnf" "/etc/mysql/my.cnf" >> ${logdir}/main.log 2>&1
if [ "$?" = "0" ]; then
echo_ok
if $(update-alternatives --list my.cnf 2>/dev/null | grep -q $(dirname "${MYSQL_INSTALL_DIR}")/mysql/etc/my.cnf 2>/dev/null) ; then
echo_skipped
else
echo_failed
error "Konnte Symlink /etc/mysql/my.cnf --> ${MYSQL_INSTALL_DIR}/etc/my.cnf nicht erstellen."
echononl "continue anyway [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/nno]: "
echo "" >> ${logdir}/main.log
echo "## - Add Path '$(dirname "${MYSQL_INSTALL_DIR}")/mysql/etc/my.cnf' for 'my.cnf' using 'update-alternatives'.." >> ${logdir}/main.log
echo "## -" >> ${logdir}/main.log
echo "update-alternatives --install /etc/mysql/my.cnf my.cnf $(dirname "${MYSQL_INSTALL_DIR}")/mysql/etc/my.cnf 300" >> ${logdir}/main.log
update-alternatives --install /etc/mysql/my.cnf my.cnf $(dirname "${MYSQL_INSTALL_DIR}")/mysql/etc/my.cnf 1300 >> ${logdir}/main.log 2>&1
if [ "$?" = "0" ]; then
echo_ok
echononl "Set link '/etc/alternatives/my.cnf' using 'update-alternatives'..."
echo "" >> ${logdir}/main.log
echo "## - Set link '/etc/alternatives/my.cnf' using 'update-alternatives'..." >> ${logdir}/main.log
echo "## -" >> ${logdir}/main.log
echo "update-alternatives --set my.cnf $(dirname "${MYSQL_INSTALL_DIR}")/mysql/etc/my.cnf" >> ${logdir}/main.log
update-alternatives --set my.cnf $(dirname "${MYSQL_INSTALL_DIR}")/mysql/etc/my.cnf
if [ "$?" = "0" ]; then
echo_ok
else
echo_failed
error "Setting link '/etc/alternatives/my.cnf using 'update-alternatives' mechanism failed!"
echononl "continue anyway [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/nno]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Abbruch durch User"
fi
else
echo_failed
error "Adding PATH '$(dirname "${MYSQL_INSTALL_DIR}")/mysql/etc/my.cnf' for Link '/etc/alternatives/my.cnf' using 'update-alternatives' mechanism failed!"
echononl "continue anyway [yes/no]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Abbruch durch User"
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/nno]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Abbruch durch User"
fi
fi
else
@ -5169,6 +5200,36 @@ else
fi # if ! $PARALLEL_INSTALLATION ; then
#echononl "Erstelle Symlink /etc/mysql/my.cnf --> ${MYSQL_INSTALL_DIR}/etc/my.cnf"
#if ! $PARALLEL_INSTALLATION ; then
#
# echo "" >> ${logdir}/main.log
# echo "## - Erstelle Symlink /etc/mysql/my.cnf --> ${MYSQL_INSTALL_DIR}/etc/my.cnf" >> ${logdir}/main.log
# echo "## -" >> ${logdir}/main.log
# echo "ln -s \"$(dirname "${MYSQL_INSTALL_DIR}")/mysql/etc/my.cnf\" \"/etc/mysql/\"" >> ${logdir}/main.log
# ln -s "$(dirname "${MYSQL_INSTALL_DIR}")/mysql/etc/my.cnf" "/etc/mysql/my.cnf" >> ${logdir}/main.log 2>&1
# if [ "$?" = "0" ]; then
# echo_ok
# else
# echo_failed
# error "Konnte Symlink /etc/mysql/my.cnf --> ${MYSQL_INSTALL_DIR}/etc/my.cnf nicht erstellen."
#
# echononl "continue anyway [yes/no]: "
# read OK
# OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
# while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
# echononl "Wrong entry! - repeat [yes/nno]: "
# read OK
# done
# [[ $OK = "yes" ]] || fatal "Abbruch durch User"
# fi
#
#else
# echo_skipped
#fi # if ! $PARALLEL_INSTALLATION ; then
echononl "Kopiere 'stopwords_utf8_iso8859-15.txt' -> ${MYSQL_INSTALL_DIR}.."
if [ -f "${MYSQL_SRC_BASE_DIR}/stopwords_utf8_iso8859-15.txt" ];then
echo "" >> ${logdir}/main.log