diff --git a/kill-maven.sh b/kill-maven.sh index 573da5b..f0754bd 100755 --- a/kill-maven.sh +++ b/kill-maven.sh @@ -7,12 +7,22 @@ set -euo pipefail # The llama-server the phraser spawns has NO "maven" in its command line (its -# args are `-m /path/to/LFM2.5-...gguf --port ...`), so a `llama-server.*maven` +# args are `-m /path/to/.gguf --port ...`), so a `llama-server.*maven` # pattern matches nothing and leaks it — the exact bug that let orphans pile up -# and OOM the box. Match the model instead. Override MODEL if you change it. -MODEL="${MODEL:-LFM2}" +# and OOM the box. +# +# We used to match the model name, defaulting to LFM2. The deploy now runs +# Qwen3.5-0.8B, so that default matched nothing and the server survived every +# kill. Match any llama-server serving a .gguf instead, so swapping the model in +# deploy/mavend.json cannot break this script again. Set MODEL to narrow it if +# some other llama-server on this box must be left alone. +MODEL="${MODEL:-}" PAT='mavend|mavsttd|mavttsd|mavweb|mavpoll|mavenclient' -LLM="llama-server.*${MODEL}" +if [ -n "$MODEL" ]; then + LLM="llama-server.*${MODEL}" +else + LLM='llama-server.*\.gguf' +fi echo "--- Sending graceful SIGTERM to Maven services ---" pkill -TERM -f "$PAT" || true