fix: bug: edge container supervisor loop never runs (and /opt/disinto-logs not created) (#555)
Two fixes: - Create /opt/disinto-logs before supervisor loop starts (tee was failing) - Replace exec caddy with background caddy + wait -n pattern so the supervisor loop subshell isn't orphaned when the parent shell exec's away Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
8dca5c7eb3
commit
098c19cb3a
1 changed files with 12 additions and 4 deletions
|
|
@ -48,15 +48,23 @@ fi
|
||||||
export HOME=/home/agent
|
export HOME=/home/agent
|
||||||
mkdir -p "$HOME"
|
mkdir -p "$HOME"
|
||||||
|
|
||||||
|
# Ensure log directory exists
|
||||||
|
mkdir -p /opt/disinto-logs
|
||||||
|
|
||||||
# Start dispatcher in background
|
# Start dispatcher in background
|
||||||
bash /opt/disinto/docker/edge/dispatcher.sh &
|
bash /opt/disinto/docker/edge/dispatcher.sh &
|
||||||
|
|
||||||
# Start supervisor loop in background
|
# Start supervisor loop in background
|
||||||
PROJECT_TOML="${PROJECT_TOML:-projects/disinto.toml}"
|
PROJECT_TOML="${PROJECT_TOML:-projects/disinto.toml}"
|
||||||
while true; do
|
(while true; do
|
||||||
bash /opt/disinto/supervisor/supervisor-run.sh "/opt/disinto/${PROJECT_TOML}" 2>&1 | tee -a /opt/disinto-logs/supervisor.log || true
|
bash /opt/disinto/supervisor/supervisor-run.sh "/opt/disinto/${PROJECT_TOML}" 2>&1 | tee -a /opt/disinto-logs/supervisor.log || true
|
||||||
sleep 1200 # 20 minutes
|
sleep 1200 # 20 minutes
|
||||||
done &
|
done) &
|
||||||
|
|
||||||
# Caddy as main process
|
# Caddy as main process — run in foreground via wait so background jobs survive
|
||||||
exec caddy run --config /etc/caddy/Caddyfile --adapter caddyfile
|
# (exec replaces the shell, which can orphan backgrounded subshells)
|
||||||
|
caddy run --config /etc/caddy/Caddyfile --adapter caddyfile &
|
||||||
|
|
||||||
|
# Exit when any child dies (caddy crash → container restart via docker compose)
|
||||||
|
wait -n
|
||||||
|
exit 1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue