浏览代码

Merge pull request #2124 from jaapmarcus/fix/mysql-error-update

Check if dir exists on update to prevent error that it failed
Raphael Schneeberger 4 年之前
父节点
当前提交
ba84b5ad93
共有 3 个文件被更改,包括 9 次插入6 次删除
  1. 5 1
      func/upgrade.sh
  2. 1 2
      install/hst-install-debian.sh
  3. 3 3
      install/hst-install-ubuntu.sh

+ 5 - 1
func/upgrade.sh

@@ -393,8 +393,12 @@ upgrade_start_backup() {
                 echo "      ---- mysql"
             fi
             cp -f /etc/mysql/*.cnf $HESTIA_BACKUP/conf/mysql/
+            if [ -d "/etc/mysql/conf.d/" ]; then
             cp -f /etc/mysql/conf.d/*.cnf $HESTIA_BACKUP/conf/mysql/ > /dev/null 2>&1
-            cp -f /etc/mysql/mariadb.conf.d/*.cnf $HESTIA_BACKUP/conf/mysql/ > /dev/null 2>&1       
+            fi
+            if [ -d "/etc/mysql/mariadb.conf.d/" ]; then
+            cp -f /etc/mysql/mariadb.conf.d/*.cnf $HESTIA_BACKUP/conf/mysql/ > /dev/null 2>&1
+            fi       
         fi
         if [[ "$DB_SYSTEM" =~ "pgsql" ]]; then
             if [ "$DEBUG_MODE" = "true" ]; then

+ 1 - 2
install/hst-install-debian.sh

@@ -1464,12 +1464,11 @@ if [ "$mysql" = 'yes' ]; then
         mycnf="my-large.cnf"
     fi
 
+    mysql_install_db >> $LOG
     # Remove symbolic link
     rm -f /etc/mysql/my.cnf
-
     # Configuring MariaDB
     cp -f $HESTIA_INSTALL_DIR/mysql/$mycnf /etc/mysql/my.cnf
-    mysql_install_db >> $LOG
 
     update-rc.d mysql defaults > /dev/null 2>&1
     systemctl start mysql >> $LOG

+ 3 - 3
install/hst-install-ubuntu.sh

@@ -1481,13 +1481,13 @@ if [ "$mysql" = 'yes' ]; then
     if [ $memory -gt 3900000 ]; then
         mycnf="my-large.cnf"
     fi
-
+    
+    # Run mysql_install_db 
+    mysql_install_db >> $LOG
     # Remove symbolic link
     rm -f /etc/mysql/my.cnf
-
     # Configuring MariaDB
     cp -f $HESTIA_INSTALL_DIR/mysql/$mycnf /etc/mysql/my.cnf
-    mysql_install_db >> $LOG
 
     update-rc.d mysql defaults > /dev/null 2>&1
     systemctl start mysql >> $LOG