#!/usr/bin/env bash # Bring up the headless display, then hand over. # # Xvfb and openbox are started as children of PID 1 (tini), NOT of the agent's # shell, so they outlive any single command. The RE container learned this the # hard way: a display owned by a shell gets reaped when that shell exits, which # reads as "Xvfb dies on its own every few minutes". set -euo pipefail : "${DISPLAY:=:97}" : "${SCREEN_GEOMETRY:=1280x720x24}" if ! xdpyinfo -display "$DISPLAY" >/dev/null 2>&1; then Xvfb "$DISPLAY" -screen 0 "$SCREEN_GEOMETRY" -nolisten tcp & for _ in $(seq 50); do xdpyinfo -display "$DISPLAY" >/dev/null 2>&1 && break sleep 0.1 done openbox >/dev/null 2>&1 & fi echo "[entrypoint] display $DISPLAY ready ($SCREEN_GEOMETRY)" if [ -d /reborn ]; then echo "[entrypoint] /reborn mounted read-only — HANDOFF.md is the contract" fi exec "$@"