From fcd8e8dd2ec0d46db52843b015f7392cdf2bba7b Mon Sep 17 00:00:00 2001 From: ZGaetano Date: Sat, 30 May 2026 16:44:23 -0400 Subject: [PATCH] fix(playout): entrypoint finds binary in /opt/casparcg for 2.4.x tarball layout --- services/playout/entrypoint.sh | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/services/playout/entrypoint.sh b/services/playout/entrypoint.sh index ee12989..d154252 100644 --- a/services/playout/entrypoint.sh +++ b/services/playout/entrypoint.sh @@ -1,42 +1,32 @@ #!/usr/bin/env bash set -euo pipefail -# Headless GL: start a virtual framebuffer unless a real DISPLAY is provided -# (a GPU node may pass through an X socket). CasparCG's mixer needs a GL context. if [ -z "${DISPLAY:-}" ]; then echo "[entrypoint] starting Xvfb on :99" Xvfb :99 -screen 0 1920x1080x24 -nolisten tcp & export DISPLAY=:99 - # Give Xvfb a moment to create the socket. for i in $(seq 1 20); do [ -e /tmp/.X11-unix/X99 ] && break sleep 0.25 done fi -# Ensure the HLS preview directory exists before CasparCG attaches its second -# FFMPEG consumer (mam-api serves /live//* from the shared volume). if [ -n "${CHANNEL_ID:-}" ]; then mkdir -p "/media/live/${CHANNEL_ID}" fi -# casparcg.config writes log/ + data/ under /media (the install dir is a symlink -# into a possibly read-only apt location), so make sure those exist + writable. mkdir -p /media/casparcg/log /media/casparcg/data /media/templates -# Launch CasparCG Server. The 2.5 deb installs the binary on PATH (symlinked to -# /usr/local/bin/casparcg at build) and takes the config file as its first arg. -# Run from /opt/casparcg (symlink to the install dir) so any relative lookups in -# the server resolve against the install tree. cd /opt/casparcg -CASPAR_BIN="casparcg" -command -v "$CASPAR_BIN" >/dev/null || CASPAR_BIN=/usr/bin/casparcg-server-2.5 CASPAR_CFG=/opt/casparcg/casparcg.config +if [ -x "./casparcg" ]; then CASPAR_BIN="./casparcg"; +elif [ -x "./CasparCG Server" ]; then CASPAR_BIN="./CasparCG Server"; +elif command -v casparcg >/dev/null; then CASPAR_BIN="casparcg"; +else echo "[entrypoint] ERROR: casparcg binary not found"; exit 1; fi echo "[entrypoint] launching CasparCG: $CASPAR_BIN $CASPAR_CFG" "$CASPAR_BIN" "$CASPAR_CFG" & CASPAR_PID=$! -# Forward termination to CasparCG so the channel closes cleanly. term() { echo "[entrypoint] terminating CasparCG ($CASPAR_PID)" kill -TERM "$CASPAR_PID" 2>/dev/null || true @@ -45,7 +35,6 @@ term() { } trap term SIGTERM SIGINT -# Launch the Node control shim (foreground). If it exits, stop the container. cd /app node src/index.js & NODE_PID=$!