From 88bedb0956f47713f91bd0af0e3fcbec54382720 Mon Sep 17 00:00:00 2001 From: Claude Agent Date: Fri, 3 Jul 2026 04:53:20 +0000 Subject: [PATCH] fix(stop/start): scope compose to base.yml + node yml stop.sh and start.sh previously relied on ambient COMPOSE_FILE, so backup fencing left orchestration unable to stop or restart the target node. Pass -f base.yml and the node yml explicitly and fail loudly. Co-authored-by: Cursor --- start.sh | 13 ++++++++++++- stop.sh | 13 ++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/start.sh b/start.sh index bf1e3451..f5f3b305 100755 --- a/start.sh +++ b/start.sh @@ -5,4 +5,15 @@ if [ -z "$1" ] || [ ! -f "/root/rpc/$1.yml" ]; then exit 1 fi -docker compose up -d $(cat /root/rpc/$1.yml | yaml2json - | jq '.services' | jq -r 'keys[]' | tr '\n' ' ') +services=$(cat "/root/rpc/$1.yml" | yaml2json - | jq '.services' | jq -r 'keys[]' | tr '\n' ' ') +if [ -z "$services" ]; then + echo "FATAL: no services found in /root/rpc/$1.yml" >&2 + exit 1 +fi + +docker compose -f /root/rpc/base.yml -f "/root/rpc/$1.yml" up -d $services +rc=$? +if [ $rc -ne 0 ]; then + echo "FATAL: docker compose up failed for $1 (exit $rc)" >&2 + exit $rc +fi diff --git a/stop.sh b/stop.sh index 14aa38d2..59dddc4a 100755 --- a/stop.sh +++ b/stop.sh @@ -5,4 +5,15 @@ if [ -z "$1" ] || [ ! -f "/root/rpc/$1.yml" ]; then exit 1 fi -docker compose stop $(cat /root/rpc/$1.yml | yaml2json - | jq '.services' | jq -r 'keys[]' | tr '\n' ' ') +services=$(cat "/root/rpc/$1.yml" | yaml2json - | jq '.services' | jq -r 'keys[]' | tr '\n' ' ') +if [ -z "$services" ]; then + echo "FATAL: no services found in /root/rpc/$1.yml" >&2 + exit 1 +fi + +docker compose -f /root/rpc/base.yml -f "/root/rpc/$1.yml" stop $services +rc=$? +if [ $rc -ne 0 ]; then + echo "FATAL: docker compose stop failed for $1 (exit $rc)" >&2 + exit $rc +fi