Refs #52
File: scripts/anvil_fork.sh
Problem
Script spawns anvil but does not trap signals. On Ctrl-C or terminal close, parent bash dies; anvil keeps running holding port 8545. Next invocation fails with 'address already in use'. Operator must pkill anvil manually.
Fix
ANVIL_PID=""
cleanup() {
if [[ -n "$ANVIL_PID" ]]; then
kill -TERM "$ANVIL_PID" 2>/dev/null || true
wait "$ANVIL_PID" 2>/dev/null || true
fi
}
trap cleanup EXIT INT TERM
anvil ... &
ANVIL_PID=$!
wait "$ANVIL_PID"
Refs #52
File: scripts/anvil_fork.sh
Problem
Script spawns anvil but does not trap signals. On Ctrl-C or terminal close, parent bash dies; anvil keeps running holding port 8545. Next invocation fails with 'address already in use'. Operator must
pkill anvilmanually.Fix