simbiot-harness/scripts/restart_after_tick.sh

17 lines
1,008 B
Bash
Executable file
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# t-261015090129: отложенный рестарт лестницы харнеса — подхватить рефлекс
# agent-channel. Ждёт, пока не останется живых LLM-воркеров (тик допишет
# дайджест и закроет задачи), максимум 15 минут, затем рестарт.
for i in $(seq 1 90); do
if ! pgrep -f "harness/_llm_worker.py" >/dev/null; then
sleep 5 # тишина 5с подряд — тик действительно закончился
if ! pgrep -f "harness/_llm_worker.py" >/dev/null; then
systemctl restart simbiot-harness.service
logger -t simbiot-restart "agent-channel: simbiot-harness перезапущен после тика (t-261015090129)"
exit 0
fi
fi
sleep 10
done
logger -t simbiot-restart "agent-channel: воркер не освободился за 15мин — рестарт без ожидания"
systemctl restart simbiot-harness.service