From b0d62c91f86230661d58704a2c203578d7fff2e3 Mon Sep 17 00:00:00 2001 From: Keith Smith Date: Sat, 31 Oct 2026 09:08:48 -0600 Subject: [PATCH] upgrade.sh: use the venv's Python for the health check, not curl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit curl isn't installed by default on this install's host, and nothing else in install.sh/upgrade.sh actually requires it — the venv's own Python (which obviously exists by the time this check runs) can make the same HTTP request via urllib, so drop the curl dependency entirely rather than adding it to the prerequisites. Co-Authored-By: Claude Sonnet 5 --- scripts/upgrade.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade.sh b/scripts/upgrade.sh index 99469fc..617bf21 100755 --- a/scripts/upgrade.sh +++ b/scripts/upgrade.sh @@ -112,7 +112,16 @@ HEALTH_PORT="${HEALTH_BIND##*:}" if [ "$HEALTH_HOST" = "0.0.0.0" ]; then HEALTH_HOST="127.0.0.1" fi -if curl -sf "http://$HEALTH_HOST:$HEALTH_PORT/health/" >/dev/null; then +# Use the venv's own Python rather than curl — curl isn't guaranteed to be +# installed on a minimal host, but the venv obviously already is. +if "$VENV_DIR/bin/python" -c " +import sys, urllib.request +try: + urllib.request.urlopen('http://$HEALTH_HOST:$HEALTH_PORT/health/', timeout=5) +except Exception as e: + print(e, file=sys.stderr) + sys.exit(1) +"; then echo "Health check OK" else echo "Health check FAILED — check: journalctl -u evection-gunicorn -n 50" >&2