peppa/infra/act-runner/supervise.sh
Асель 3ab408eb70 PEP-57: CI for factory projects — act_runner, template workflow, connect CI
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 14:19:11 +05:00

16 lines
676 B
Bash
Executable File

#!/bin/sh
# Держит по одному `act_runner daemon` на каждую регистрацию /data/runners/<имя>/.runner;
# новые регистрации (peppa-runner-register) и упавшие демоны подхватываются за 10 секунд.
mkdir -p /data/runners
while :; do
for d in /data/runners/*/; do
[ -f "$d.runner" ] || continue
name=$(basename "$d")
if [ -f "$d.pid" ] && kill -0 "$(cat "$d.pid")" 2>/dev/null; then continue; fi
echo "[supervise] start $name"
(cd "$d" && exec act_runner daemon --config /etc/act_runner/config.yaml 2>&1) | sed "s/^/[$name] /" &
echo $! > "$d.pid"
done
sleep 10
done