diff --git a/bin/ncp-diag b/bin/ncp-diag index 3276e9bc4..28e7c1a4e 100644 --- a/bin/ncp-diag +++ b/bin/ncp-diag @@ -37,7 +37,7 @@ SWP="$( swapon | tail -1 | awk '{ print $1 }' )" echo "swapfile|$SWP" # Database -DBDIR=$( grep datadir /etc/mysql/mariadb.conf.d/50-server.cnf | awk -F "= " '{ print $2 }' ) +DBDIR=$( grep datadir /etc/mysql/mariadb.conf.d/90-ncp.cnf | awk -F "= " '{ print $2 }' ) test -d "$DBDIR" || DBDIRINFO=" (doesn't exist)" echo "dbdir|$DBDIR$DBDIRINFO" diff --git a/docker-armhf/lamp/Dockerfile b/docker-armhf/lamp/Dockerfile index d5a9e50ad..8888a581c 100644 --- a/docker-armhf/lamp/Dockerfile +++ b/docker-armhf/lamp/Dockerfile @@ -21,7 +21,7 @@ mysqladmin -u root shutdown; \ # mariaDB fixups (move database to /data-ro, which will be in a persistent volume) mkdir -p /data-ro /data; \ mv /var/lib/mysql /data-ro/database; \ -sed -i "s|^datadir.*|datadir = /data-ro/database|" /etc/mysql/mariadb.conf.d/50-server.cnf; \ +sed -i "s|^datadir.*|datadir = /data-ro/database|" /etc/mysql/mariadb.conf.d/90-ncp.cnf; \ # package cleanup apt-get autoremove -y; \ diff --git a/docker-common/lamp/010lamp b/docker-common/lamp/010lamp index 5007491c5..6948af92b 100755 --- a/docker-common/lamp/010lamp +++ b/docker-common/lamp/010lamp @@ -25,7 +25,7 @@ echo "Starting Apache" /usr/sbin/apache2ctl start # adjust the dbdir to the persistent storage -sed -i "s|^datadir.*|datadir = /data/database|" /etc/mysql/mariadb.conf.d/50-server.cnf +sed -i "s|^datadir.*|datadir = /data/database|" /etc/mysql/mariadb.conf.d/90-ncp.cnf # start echo "Starting mariaDB" diff --git a/docker/lamp/Dockerfile b/docker/lamp/Dockerfile index 9470a4762..516dc204a 100644 --- a/docker/lamp/Dockerfile +++ b/docker/lamp/Dockerfile @@ -21,7 +21,7 @@ mysqladmin -u root shutdown; \ # mariaDB fixups (move database to /data-ro, which will be in a persistent volume) mkdir -p /data-ro /data; \ mv /var/lib/mysql /data-ro/database; \ -sed -i "s|^datadir.*|datadir = /data-ro/database|" /etc/mysql/mariadb.conf.d/50-server.cnf; \ +sed -i "s|^datadir.*|datadir = /data-ro/database|" /etc/mysql/mariadb.conf.d/90-ncp.cnf; \ # package cleanup apt-get autoremove -y; \ diff --git a/etc/ncp-config.d/nc-database.sh b/etc/ncp-config.d/nc-database.sh index c715811b3..279bfaddb 100644 --- a/etc/ncp-config.d/nc-database.sh +++ b/etc/ncp-config.d/nc-database.sh @@ -21,13 +21,13 @@ or the database will fail. is_active() { - local SRCDIR=$( grep datadir /etc/mysql/mariadb.conf.d/50-server.cnf | awk -F "= " '{ print $2 }' ) + local SRCDIR=$( grep datadir /etc/mysql/mariadb.conf.d/90-ncp.cnf | awk -F "= " '{ print $2 }' ) [[ "$SRCDIR" != "/var/lib/mysql" ]] } configure() { - local SRCDIR=$( grep datadir /etc/mysql/mariadb.conf.d/50-server.cnf | awk -F "= " '{ print $2 }' ) + local SRCDIR=$( grep datadir /etc/mysql/mariadb.conf.d/90-ncp.cnf | awk -F "= " '{ print $2 }' ) [ -d "$SRCDIR" ] || { echo -e "database directory $SRCDIR not found"; return 1; } [ -d "$DBDIR_" ] && { @@ -54,7 +54,7 @@ configure() echo "moving database to $DBDIR_..." service mysql stop mv "$SRCDIR" "$DBDIR_" && \ - sed -i "s|^datadir.*|datadir = $DBDIR_|" /etc/mysql/mariadb.conf.d/50-server.cnf + sed -i "s|^datadir.*|datadir = $DBDIR_|" /etc/mysql/mariadb.conf.d/90-ncp.cnf service mysql start sudo -u www-data php occ maintenance:mode --off diff --git a/lamp.sh b/lamp.sh index e828c1387..8e05eee83 100644 --- a/lamp.sh +++ b/lamp.sh @@ -117,9 +117,10 @@ EOF $APTINSTALL ssl-cert # self signed snakeoil certs # configure MariaDB ( UTF8 4 byte support ) - sed -i '/\[mysqld\]/ainnodb_large_prefix=on' /etc/mysql/mariadb.conf.d/50-server.cnf - sed -i '/\[mysqld\]/ainnodb_file_per_table=1' /etc/mysql/mariadb.conf.d/50-server.cnf - sed -i '/\[mysqld\]/ainnodb_file_format=barracuda' /etc/mysql/mariadb.conf.d/50-server.cnf + cp /etc/mysql/mariadb.conf.d/50-server.cnf /etc/mysql/mariadb.conf.d/90-ncp.cnf + sed -i '/\[mysqld\]/ainnodb_large_prefix=on' /etc/mysql/mariadb.conf.d/90-ncp.cnf + sed -i '/\[mysqld\]/ainnodb_file_per_table=1' /etc/mysql/mariadb.conf.d/90-ncp.cnf + sed -i '/\[mysqld\]/ainnodb_file_format=barracuda' /etc/mysql/mariadb.conf.d/90-ncp.cnf # launch mariadb if not already running if ! pgrep -c mysqld &>/dev/null; then diff --git a/update.sh b/update.sh index c544bf428..95056881a 100755 --- a/update.sh +++ b/update.sh @@ -176,6 +176,13 @@ EOF # install preview generator sudo -u www-data php /var/www/nextcloud/occ app:install previewgenerator sudo -u www-data php /var/www/nextcloud/occ app:enable previewgenerator + + # use separate db config file + [[ -f /etc/mysql/mariadb.conf.d/90-ncp.cnf ]] || { + cp /etc/mysql/mariadb.conf.d/50-server.cnf /etc/mysql/mariadb.conf.d/90-ncp.cnf + service mysql restart + } + } # end - only live updates exit 0