fix(playout): locate CasparCG 2.5 binary at /usr/bin/casparcg-server-2.5
First 2.5 build got past the deb install but the binary-discovery step produced an empty $BIN (test -n failed): the 2.5 deb names its executable casparcg-server-2.5, which the old case pattern (*/casparcg, */CasparCG Server) didn't match. Broaden the match to /usr/bin/*casparcg*server*, fall back to the known /usr/bin/casparcg-server-2.5, symlink it to /usr/local/bin/casparcg, and make /opt/casparcg a real dir for our config (no longer symlinked onto /usr/bin). Entrypoint launches `casparcg <config>` from PATH instead of ./casparcg in a cwd. Still NOT runtime-validated: 2.5 may reject the 2.3-era casparcg.config schema (a bad config shows up as "Configuration file --version was not found"); the deb ships a reference config at /usr/share/casparcg-server-2.5/casparcg.config to diff against at smoke time. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
9436434599
commit
02631f7b96
2 changed files with 20 additions and 18 deletions
|
|
@ -40,8 +40,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
|
|
||||||
# ── CasparCG Server 2.5.0 (via .deb) ─────────────────────────────────────────
|
# ── CasparCG Server 2.5.0 (via .deb) ─────────────────────────────────────────
|
||||||
# apt resolves the server's runtime deps (GL, ffmpeg, openal, sndfile, …). The
|
# apt resolves the server's runtime deps (GL, ffmpeg, openal, sndfile, …). The
|
||||||
# deb's install dir is discovered from its file list and symlinked to
|
# 2.5 deb installs the executable as /usr/bin/casparcg-server-2.5 and a default
|
||||||
# /opt/casparcg so the entrypoint + config (which run from that dir) stay valid.
|
# config under /usr/share/casparcg-server-2.5/. We discover the binary from the
|
||||||
|
# package file list (matching casparcg-server*, since the name is versioned),
|
||||||
|
# and symlink its dir to /opt/casparcg so the entrypoint + config stay stable.
|
||||||
WORKDIR /tmp/caspar
|
WORKDIR /tmp/caspar
|
||||||
RUN set -eux; \
|
RUN set -eux; \
|
||||||
curl -fsSL "$CASPAR_CEF_DEB_URL" -o cef.deb; \
|
curl -fsSL "$CASPAR_CEF_DEB_URL" -o cef.deb; \
|
||||||
|
|
@ -52,14 +54,14 @@ RUN set -eux; \
|
||||||
echo "casparcg server package: $PKG"; \
|
echo "casparcg server package: $PKG"; \
|
||||||
dpkg -L "$PKG"; \
|
dpkg -L "$PKG"; \
|
||||||
BIN=$(dpkg -L "$PKG" | while read -r f; do \
|
BIN=$(dpkg -L "$PKG" | while read -r f; do \
|
||||||
[ -x "$f" ] || continue; \
|
[ -f "$f" ] && [ -x "$f" ] || continue; \
|
||||||
case "$f" in */casparcg|*/CasparCG\ Server) echo "$f";; esac; \
|
case "$f" in /usr/bin/*casparcg*server*|*/casparcg|*/CasparCG\ Server) echo "$f";; esac; \
|
||||||
done | head -1); \
|
done | head -1); \
|
||||||
test -n "$BIN"; \
|
[ -n "$BIN" ] || BIN=/usr/bin/casparcg-server-2.5; \
|
||||||
DIR=$(dirname "$BIN"); \
|
test -x "$BIN"; \
|
||||||
echo "casparcg binary=$BIN dir=$DIR"; \
|
echo "casparcg binary=$BIN"; \
|
||||||
if [ "$DIR" != "/opt/casparcg" ]; then rm -rf /opt/casparcg; ln -sfn "$DIR" /opt/casparcg; fi; \
|
ln -sfn "$BIN" /usr/local/bin/casparcg; \
|
||||||
test -x "/opt/casparcg/$(basename "$BIN")"; \
|
rm -rf /opt/casparcg; mkdir -p /opt/casparcg; \
|
||||||
cd /; rm -rf /tmp/caspar /var/lib/apt/lists/*
|
cd /; rm -rf /tmp/caspar /var/lib/apt/lists/*
|
||||||
|
|
||||||
# ── NDI runtime (optional) ───────────────────────────────────────────────────
|
# ── NDI runtime (optional) ───────────────────────────────────────────────────
|
||||||
|
|
|
||||||
|
|
@ -24,16 +24,16 @@ fi
|
||||||
# into a possibly read-only apt location), so make sure those exist + writable.
|
# into a possibly read-only apt location), so make sure those exist + writable.
|
||||||
mkdir -p /media/casparcg/log /media/casparcg/data /media/templates
|
mkdir -p /media/casparcg/log /media/casparcg/data /media/templates
|
||||||
|
|
||||||
# Launch CasparCG Server from its install dir (it reads ./casparcg.config and
|
# Launch CasparCG Server. The 2.5 deb installs the binary on PATH (symlinked to
|
||||||
# resolves relative media paths against the configured media folder). The deb
|
# /usr/local/bin/casparcg at build) and takes the config file as its first arg.
|
||||||
# install names the binary either 'casparcg' or 'CasparCG Server' depending on
|
# Run from /opt/casparcg (symlink to the install dir) so any relative lookups in
|
||||||
# version, so probe both.
|
# the server resolve against the install tree.
|
||||||
cd /opt/casparcg
|
cd /opt/casparcg
|
||||||
CASPAR_BIN="./casparcg"
|
CASPAR_BIN="casparcg"
|
||||||
[ -x "$CASPAR_BIN" ] || CASPAR_BIN="./CasparCG Server"
|
command -v "$CASPAR_BIN" >/dev/null || CASPAR_BIN=/usr/bin/casparcg-server-2.5
|
||||||
[ -x "$CASPAR_BIN" ] || CASPAR_BIN="./casparcg-launcher"
|
CASPAR_CFG=/opt/casparcg/casparcg.config
|
||||||
echo "[entrypoint] launching CasparCG: $CASPAR_BIN"
|
echo "[entrypoint] launching CasparCG: $CASPAR_BIN $CASPAR_CFG"
|
||||||
"$CASPAR_BIN" &
|
"$CASPAR_BIN" "$CASPAR_CFG" &
|
||||||
CASPAR_PID=$!
|
CASPAR_PID=$!
|
||||||
|
|
||||||
# Forward termination to CasparCG so the channel closes cleanly.
|
# Forward termination to CasparCG so the channel closes cleanly.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue