From dfb8d26b62c689a3390310c5cceba2b862d551dc Mon Sep 17 00:00:00 2001 From: kami Date: Fri, 31 Jul 2026 02:15:30 +0400 Subject: [PATCH] Fix kill-maven.sh so it actually kills llama-server The MODEL default was LFM2, but the deploy runs Qwen3.5-0.8B, so the pkill pattern matched nothing and the server survived every kill. Now matches any llama-server serving a .gguf, so changing the model in deploy/mavend.json cannot break the script again. MODEL still narrows it. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01CGeSZxh1DCtRxmFVSYVGvJ --- kill-maven.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) 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