From 1223afb13ebae6a9437c956da2d38d68969f8ea2 Mon Sep 17 00:00:00 2001 From: Christoph Date: Thu, 27 Feb 2020 16:44:00 +0100 Subject: [PATCH] install_mysql.sh: add '--defaults-file' option to mysql start command. This option MUST be the firts commanline option. --- install_mysql.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/install_mysql.sh b/install_mysql.sh index 933b738..336ea0a 100755 --- a/install_mysql.sh +++ b/install_mysql.sh @@ -5063,6 +5063,32 @@ if $INSTALL_SYSTEMD_SERVICE ; then [[ $OK = "yes" ]] || fatal "Abbruch durch User" fi + + echononl "Add '--defaults-file=..' to ExecStart command line at systemd service file.." + echo "" >> ${logdir}/main.log + echo "## - Add '--defaults-file=..' to ExecStart command line at systemd service file.." >> ${logdir}/main.log + echo "## -" >> ${logdir}/main.log + echo "perl -i -n -p -e \"s&^(\s*ExecStart=[^\s]+)\s+(.*)&\1 --defaults-file=${MYSQL_INSTALL_DIR}/etc/my.cnf \2&\" /etc/systemd/system/$MYSQL_SERVICE_FILE" >> ${logdir}/main.log + + perl -i -n -p -e "s&^(\s*ExecStart=[^\s]+)\s+(.*)&\1 --defaults-file=${MYSQL_INSTALL_DIR}/etc/my.cnf \2&" \ + /etc/systemd/system/$MYSQL_SERVICE_FILE >> ${logdir}/main.log + if [[ $_retval -eq 0 ]]; then + echo_ok + else + echo_failed + error "Modifiing ExecStart command line at '/etc/systemd/system/${MYSQL_SERVICE_FILE}' 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 + + echononl "Set open_files_limit (LimitNOFILE) to $(ulimit -Hn) .." echo "" >> ${logdir}/main.log echo "## - Set open_files_limit (LimitNOFILE) to $(ulimit -Hn) .." >> ${logdir}/main.log