test: verify the recorded PID is weed before stopping it

A prerequisite failure leaves a stale weed-server.pid in place; the PID
may have been reused by an unrelated process.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Chris Lu
2026-10-08 07:09:39 -07:00
co-authored by Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
parent 561a6c06c4
commit 696aa04cc2
+6 -3
View File
@@ -76,9 +76,12 @@ start-server: check-deps
stop-server:
@if [ -f weed-server.pid ]; then \
echo "Stopping SeaweedFS server..."; \
kill $$(cat weed-server.pid) 2>/dev/null || true; \
sleep 2; \
pid=$$(cat weed-server.pid); \
if ps -p $$pid -o comm= 2>/dev/null | grep -q weed; then \
echo "Stopping SeaweedFS server..."; \
kill $$pid 2>/dev/null || true; \
sleep 2; \
fi; \
rm -f weed-server.pid; \
fi