From 3fc0fd3c34dda0669328b7d64a1e0c2cc9c579b9 Mon Sep 17 00:00:00 2001 From: jerry Date: Mon, 24 Aug 2026 18:54:16 +0000 Subject: [PATCH] rescue round 2: diagnose + clean restart --- rescue2.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 rescue2.sh diff --git a/rescue2.sh b/rescue2.sh new file mode 100644 index 0000000..fb37e4b --- /dev/null +++ b/rescue2.sh @@ -0,0 +1,24 @@ +#!/bin/bash +echo "=== stopping deployer + any stray builds ===" +sudo systemctl stop hal8-deployer.timer hal8-deployer.service 2>/dev/null +sudo systemctl disable hal8-deployer.timer 2>/dev/null +sudo pkill -f "docker build" 2>/dev/null; sudo pkill -f vite 2>/dev/null +sleep 2 +echo "=== hal8 container state ===" +sudo docker inspect hal8-hal8-1 --format 'status={{.State.Status}} restarts={{.RestartCount}} oomkilled={{.State.OOMKilled}} exitcode={{.State.ExitCode}} started={{.State.StartedAt}}' +echo "=== last 25 hal8 logs ===" +sudo docker logs --tail 25 hal8-hal8-1 2>&1 +echo "=== memory now ===" +free -m | head -2 +echo "=== clean restart on quiet box ===" +sudo docker restart hal8-hal8-1 >/dev/null +echo "restarted; waiting 100s for boot..." +sleep 100 +for i in 1 2 3 4 5 6; do + code=$(curl -s -o /dev/null -w "%{http_code}" --max-time 15 https://hal8.odyssey-works.io/auth || echo 000) + echo "health check $i: HTTP $code" + [ "$code" = "200" ] && break + sleep 20 +done +sudo docker inspect hal8-hal8-1 --format 'final: status={{.State.Status}} oomkilled={{.State.OOMKilled}}' +free -m | head -2