Skip to content

Commit ba84b5a

Browse files
authored
Merge pull request hestiacp#2124 from jaapmarcus/fix/mysql-error-update
Check if dir exists on update to prevent error that it failed
2 parents d5c8f00 + 349b289 commit ba84b5a

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

func/upgrade.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,12 @@ upgrade_start_backup() {
393393
echo " ---- mysql"
394394
fi
395395
cp -f /etc/mysql/*.cnf $HESTIA_BACKUP/conf/mysql/
396+
if [ -d "/etc/mysql/conf.d/" ]; then
396397
cp -f /etc/mysql/conf.d/*.cnf $HESTIA_BACKUP/conf/mysql/ > /dev/null 2>&1
397-
cp -f /etc/mysql/mariadb.conf.d/*.cnf $HESTIA_BACKUP/conf/mysql/ > /dev/null 2>&1
398+
fi
399+
if [ -d "/etc/mysql/mariadb.conf.d/" ]; then
400+
cp -f /etc/mysql/mariadb.conf.d/*.cnf $HESTIA_BACKUP/conf/mysql/ > /dev/null 2>&1
401+
fi
398402
fi
399403
if [[ "$DB_SYSTEM" =~ "pgsql" ]]; then
400404
if [ "$DEBUG_MODE" = "true" ]; then

install/hst-install-debian.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1464,12 +1464,11 @@ if [ "$mysql" = 'yes' ]; then
14641464
mycnf="my-large.cnf"
14651465
fi
14661466

1467+
mysql_install_db >> $LOG
14671468
# Remove symbolic link
14681469
rm -f /etc/mysql/my.cnf
1469-
14701470
# Configuring MariaDB
14711471
cp -f $HESTIA_INSTALL_DIR/mysql/$mycnf /etc/mysql/my.cnf
1472-
mysql_install_db >> $LOG
14731472

14741473
update-rc.d mysql defaults > /dev/null 2>&1
14751474
systemctl start mysql >> $LOG

install/hst-install-ubuntu.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,13 +1481,13 @@ if [ "$mysql" = 'yes' ]; then
14811481
if [ $memory -gt 3900000 ]; then
14821482
mycnf="my-large.cnf"
14831483
fi
1484-
1484+
1485+
# Run mysql_install_db
1486+
mysql_install_db >> $LOG
14851487
# Remove symbolic link
14861488
rm -f /etc/mysql/my.cnf
1487-
14881489
# Configuring MariaDB
14891490
cp -f $HESTIA_INSTALL_DIR/mysql/$mycnf /etc/mysql/my.cnf
1490-
mysql_install_db >> $LOG
14911491

14921492
update-rc.d mysql defaults > /dev/null 2>&1
14931493
systemctl start mysql >> $LOG

0 commit comments

Comments
 (0)