This commit is contained in:
eric
2026-03-28 16:27:42 -05:00
parent 6f79f259a1
commit 37ab25911a
16 changed files with 1176 additions and 330 deletions

View File

@@ -25,6 +25,7 @@ REMOTE_BASE = os.environ.get("LIVE_DEPLOY_PATH", "/home/live/douyinyoutube").rst
REPO_ROOT = Path(__file__).resolve().parent.parent
FILES = [
"src/android_control.py",
"src/control_plane.py",
"src/web_process_backend.py",
"src/hub_routes.py",
@@ -39,7 +40,9 @@ FILES = [
"scripts/linux/service_ctl.sh",
"scripts/linux/lib/common.sh",
"services/srs/docker-compose.yml",
"services/srs/data/index.html",
"services/neko/docker-compose.yml",
"services/neko/docker-compose.firefox.yml",
"services/neko/chromium.conf",
"services/neko/policies/policies.json",
"services/neko/.gitignore",
@@ -280,6 +283,25 @@ def main() -> int:
"done; echo curl_health_failed; exit 0",
timeout=120,
)
# 若健康检查失败,再尝试 reset-failed + start部分板子 restart 后 unit 未 active
recover_console = (
f"echo '{PASS}' | sudo -S bash -c '"
"systemctl reset-failed live-console.service 2>/dev/null; "
"systemctl start live-console.service 2>/dev/null; "
"sleep 5; "
"systemctl is-active live-console.service || true; "
"journalctl -u live-console.service -n 25 --no-pager 2>/dev/null || true'"
)
run_logged(client, log_path, "recover_live_console_if_needed", recover_console, timeout=90)
run_logged(
client,
log_path,
"curl_health_after_recover",
"for i in $(seq 1 12); do "
"if curl -sf -m 4 http://127.0.0.1:8001/health >/dev/null 2>&1; then echo health_ok_recover; exit 0; fi; "
"sleep 2; done; echo still_failed; exit 0",
timeout=60,
)
run_logged(
client,
log_path,