From 05e1418efa56a773c295a2e072796e220d8d8f51 Mon Sep 17 00:00:00 2001 From: yyamashita Date: Sat, 31 Oct 2026 22:45:58 +0900 Subject: hetzner-admin: stop/start individual services, shown as STOPPED on status page - run-command.sh: services / stop / start for app and infra stacks (not caddy, hetzner-admin, status). Stopped names go to status/stopped.txt (gitignored). - status: a stopped service that does not respond is STOPPED (gray), excluded from uptime and DOWN alerts. If it responds it is UP as usual. - Infra deploy.sh skips stopped stacks; app repo pushes clear the flag. - claude-code@.service: Restart=on-failure, and restart-sessions.sh restarts one unit at a time, to avoid the tmux "server exited unexpectedly" race. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01N5eS3U54gzjRXzm65Np1RS --- tests/check.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'tests') diff --git a/tests/check.sh b/tests/check.sh index a19b55e..e0c9bed 100755 --- a/tests/check.sh +++ b/tests/check.sh @@ -84,6 +84,32 @@ for node in ast.walk(tree): EOF ) +echo "" +echo "=== hetzner-admin: SERVICES が run-command.sh / status/targets.txt と一致するか ===" +admin_services=$(python3 - <<'EOF' +import ast +tree = ast.parse(open("hetzner-admin/app.py").read()) +for node in ast.walk(tree): + if isinstance(node, ast.Assign) and getattr(node.targets[0], "id", "") == "SERVICES": + print(" ".join(e.value for e in node.value.elts)) +EOF +) +script_services=$(sed -n 's/^SERVICES="\(.*\)"$/\1/p' hetzner-admin/run-command.sh) +if [[ "$admin_services" == "$script_services" ]]; then + ok "app.py と run-command.sh の SERVICES が一致" +else + ng "SERVICES 不一致: app.py=[$admin_services] run-command.sh=[$script_services]" +fi +for name in $admin_services; do + if ! grep -qE "^ +$name\) " hetzner-admin/run-command.sh; then + ng "run-command.sh の service_compose に $name がない" + elif ! grep -qE "^$name\s" status/targets.txt; then + ng "status/targets.txt に $name がない(ステータスページと連動しない)" + else + ok "service: $name" + fi +done + echo "" echo "=== 秘密ファイルがコミットされていないか ===" for name in users.conf id_rsa id_rsa.pub .env; do -- cgit v1.3