From a97397102a671572cf22b0276d8d2a8fac57af5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Kn=C3=B6ppler?= <6317548+theCalcaholic@users.noreply.github.com> Date: Tue, 30 Sep 2025 21:05:04 +0200 Subject: [PATCH] Fix armbian builds --- bin/ncp/CONFIG/nc-init.sh | 17 +++++++++++++---- bin/ncp/CONFIG/nc-nextcloud.sh | 4 ++++ build/armbian/armbian.sh | 6 ++---- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/bin/ncp/CONFIG/nc-init.sh b/bin/ncp/CONFIG/nc-init.sh index ed8d8a24..2445b7ed 100644 --- a/bin/ncp/CONFIG/nc-init.sh +++ b/bin/ncp/CONFIG/nc-init.sh @@ -53,6 +53,7 @@ EOF ## INITIALIZE NEXTCLOUD # make sure redis is running first + REDISPASS="$( grep "^requirepass" /etc/redis/redis.conf | cut -f2 -d' ' )" if ! pgrep -c redis-server &>/dev/null; then mkdir -p /var/run/redis mkdir -p /var/log/ @@ -61,10 +62,18 @@ EOF redis_pid=$! for i in {1..5} do - ps -p $PID || [[ $i -lt 5 ]] || { - echo "FAILED TO START REDIS" - return 1 - } && break + + if redis-cli -s //var/run/redis/redis.sock -a "$REDISPASS" ping | grep PONG + then + break + else + if [[ $i -ge 5 ]] + then + echo "FAILED TO START REDIS" + cat /var/log/redis.log /var/log/redis/redis-server.log + return 1 + fi + fi sleep 3 done fi diff --git a/bin/ncp/CONFIG/nc-nextcloud.sh b/bin/ncp/CONFIG/nc-nextcloud.sh index d2d1cc79..70732b5e 100644 --- a/bin/ncp/CONFIG/nc-nextcloud.sh +++ b/bin/ncp/CONFIG/nc-nextcloud.sh @@ -60,6 +60,10 @@ install() sed -i 's|# rename-command CONFIG ""|rename-command CONFIG ""|' $REDIS_CONF sed -i "s|^port.*|port 0|" $REDIS_CONF echo "maxmemory $REDIS_MEM" >> $REDIS_CONF + if [[ "$ARMBIAN_BUILD" == "yes" ]] + then + echo "ignore-warnings ARM64-COW-BUG" >> $REDIS_CONF + fi echo 'vm.overcommit_memory = 1' >> /etc/sysctl.conf if is_lxc; then diff --git a/build/armbian/armbian.sh b/build/armbian/armbian.sh index dbf6115f..2078c410 100644 --- a/build/armbian/armbian.sh +++ b/build/armbian/armbian.sh @@ -33,13 +33,11 @@ echo -e "\nInstalling NextCloudPi" hostname -F /etc/hostname # fix 'sudo resolve host' errors -CODE_DIR="$(pwd)" DBG=x bash install.sh || { +ARMBIAN_BUILD=yes CODE_DIR="$(pwd)" DBG=x bash install.sh || { echo "SOMETHING WENT WRONG, EXITING..." - ! [ -f /var/log/redis.log ] || cat /var/log/redis.log - sudo -u redis redis-server /etc/redis/redis.conf - sleep 120 exit 1 } +sed -i 's/^ignore-warnings ARM64-COW-BUG//' /etc/redis/redis.conf echo -e "\nPostinstall..." run_app_unsafe post-inst.sh