diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index 51d9638..4429fa2 100644 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -15,6 +15,12 @@ fi DEFAULT_VAULT_PATH="$(python /app/scripts/render_config.py | tail -n 1)" # Start a virtual X server for the official Obsidian desktop app. +# Some container/image restarts can leave stale X lock/socket files behind. In +# this dedicated container nothing else should own DISPLAY, so clear them before +# starting Xvfb to avoid "Server is already active for display" false positives. +DISPLAY_NUMBER="${DISPLAY#:}" +rm -f "/tmp/.X${DISPLAY_NUMBER}-lock" "/tmp/.X11-unix/X${DISPLAY_NUMBER}" + Xvfb "$DISPLAY" -screen 0 "${XVFB_SCREEN:-1280x1024x24}" -nolisten tcp >/tmp/xvfb.log 2>&1 & XVFB_PID=$!