From c9d302fe44db34eafd9cdc6aeadd96525dccb586 Mon Sep 17 00:00:00 2001 From: RomanNum3ral Date: Wed, 18 Mar 2026 18:10:10 +0000 Subject: [PATCH] Update arch_install.sh --- arch_install.sh | 68 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 62 insertions(+), 6 deletions(-) diff --git a/arch_install.sh b/arch_install.sh index 28b95e7..a9ea777 100644 --- a/arch_install.sh +++ b/arch_install.sh @@ -37,11 +37,15 @@ SMB_FSTAB_OPTIONS="rw,credentials=${SMB_CREDENTIALS_FILE},uid=http,gid=http,ioch # INTERNALS ######################################## -PHP_INI="/etc/php-legacy/php.ini" +PHP_ETC_DIR="/etc/php-legacy" +PHP_INI="${PHP_ETC_DIR}/php.ini" +PHP_CONF_D="${PHP_ETC_DIR}/conf.d" PHP_FPM_POOL_CONF="/etc/php-legacy/php-fpm.d/www.conf" + HTTPD_CONF="/etc/httpd/conf/httpd.conf" HTTPD_NEXTCLOUD_CONF="/etc/httpd/conf/extra/nextcloud.conf" HTTPD_WELLKNOWN_CONF="/etc/httpd/conf/extra/nextcloud-wellknown.conf" + VALKEY_CONF="/etc/valkey/valkey.conf" log() { @@ -80,8 +84,16 @@ ensure_line() { grep -Fqx "$line" "$file" || echo "$line" >> "$file" } +write_ini() { + local file="$1" + shift + cat > "$file" <> "${VALKEY_CONF}" fi -# Disable unix socket lines to prevent service start issues sed -ri 's|^[#[:space:]]*unixsocket .*|# unixsocket disabled by install script|g' "${VALKEY_CONF}" || true sed -ri 's|^[#[:space:]]*unixsocketperm .*|# unixsocketperm disabled by install script|g' "${VALKEY_CONF}" || true @@ -350,10 +392,23 @@ if [[ "${ENABLE_SMB_MOUNT}" == "true" ]]; then chown "${APACHE_RUN_USER}:${APACHE_RUN_GROUP}" "${SMB_MOUNTPOINT}" || true fi +log "Verifying PHP modules before install" + +php-legacy -m | grep -qi '^gd$' || die "PHP GD module is still not loaded." +php-legacy -m | grep -qi '^mysqli$' || die "PHP mysqli module is still not loaded." +php-legacy -m | grep -qi '^PDO$' || die "PHP PDO core is still not loaded." +php-legacy -m | grep -qi '^pdo_mysql$' || die "PHP pdo_mysql module is still not loaded." +php-legacy -m | grep -qi '^intl$' || die "PHP intl module is still not loaded." +php-legacy -m | grep -qi '^redis$' || die "PHP redis module is still not loaded." +php-legacy -m | grep -qi '^apcu$' || die "PHP apcu module is still not loaded." + +systemctl restart php-fpm-legacy +systemctl restart httpd + log "Installing Nextcloud non-interactively" if [[ ! -f "${NEXTCLOUD_CONFIG_DIR}/config/config.php" ]] || grep -q "CAN_INSTALL" "${NEXTCLOUD_CONFIG_DIR}/config/config.php" 2>/dev/null; then - sudo -u "${APACHE_RUN_USER}" php-legacy "${NEXTCLOUD_WEBROOT}/occ" maintenance:install \ + sudo -u "${APACHE_RUN_USER}" /usr/bin/php-legacy /usr/bin/occ maintenance:install \ --database "mysql" \ --database-name "${DB_NAME}" \ --database-user "${DB_USER}" \ @@ -385,6 +440,7 @@ occ config:system:set maintenance_window_start --type=integer --value=1 || true log "Enabling cron" systemctl enable --now nextcloud-cron.service || true +systemctl enable --now nextcloud-cron.timer || true log "Final service restarts"