Cette révision appartient à :
2026-09-19 19:00:42 +02:00
Parent aa388dd135
révision 7b2c073f6b
2 fichiers modifiés avec 34 ajouts et 2 suppressions
+33 -2
Voir le fichier
@@ -289,9 +289,32 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi
# Upgrade
else
run_path pre-upgrade
run_as 'php /var/www/html/occ upgrade'
echo "Enabling maintenance mode..."
run_as 'php /var/www/html/occ maintenance:mode --on'
# Start Apache early so users get the maintenance page
if expr "$1" : "apache" 1>/dev/null; then
echo "Starting Apache in background..."
apache2-foreground &
APACHE_PID=$!
# Give Apache a few seconds to start
sleep 3
fi
echo "Running Nextcloud upgrade..."
if run_as 'php /var/www/html/occ upgrade'; then
echo "Upgrade completed."
echo "Disabling maintenance mode..."
run_as 'php /var/www/html/occ maintenance:mode --off'
else
echo "Upgrade failed! Leaving maintenance mode enabled."
exit 1
fi
get_enabled_apps > /tmp/list_after
disabled_apps="$(comm -23 /tmp/list_before /tmp/list_after || true)"
@@ -302,6 +325,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
rm -f /tmp/list_before /tmp/list_after
run_path post-upgrade
fi
echo "Initializing finished"
@@ -327,4 +351,11 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
run_path before-starting
fi
exec "$@"
# If Apache was already started during upgrade,
# keep this process attached to it.
if [ -n "${APACHE_PID:-}" ]; then
echo "Apache already running."
wait "$APACHE_PID"
else
exec "$@"
fi
Lien symbolique
+1
Voir le fichier
@@ -0,0 +1 @@
34