box-stop: end one load by name instead of every load (#455)

The box is under memory pressure (swap full), so one wasteful load, such as the UK's
limited batches that relist every held year, can be ended without ending the rest.


Claude-Session: https://claude.ai/code/session_019MDtmsWmge2YFXGRyA2au4

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
CatoandClaude authored and GitHub committed 2026-11-09 11:02:01 +01:00
1 parent 610f05ed1a
commit 0b3ee0560d
1 file changed
+9
+9
View File
@@ -165,7 +165,16 @@ jobs:
exit 0
fi
if [ "$SOURCE" = "box-stop" ]; then
# Only the loads whose command names the "publisher" input (a source or publisher key such as
# ukleg); "all" ends every one. The input's default names nothing, so a bare run ends nothing.
for pid in $(holders); do
if [ "$PUBLISHER" != "all" ]; then
named=0
for t in $(tree "$pid"); do
tr '\0' ' ' < "/proc/$t/cmdline" 2>/dev/null | grep -q -- "$PUBLISHER" && named=1
done
[ "$named" = 1 ] || continue
fi
echo "ending the tree of pid $pid"
for t in $(tree "$pid"); do kill -TERM "$t" 2>/dev/null || true; done
done