fix: clear stale Xvfb display locks on startup
Build and Push Docker Container / build-and-push (push) Successful in 4m53s
Build and Push Docker Container / build-and-push (push) Successful in 4m53s
- Remove stale X lock and socket files before starting Xvfb. - Prevent false active-display errors after container restarts. - Keep Obsidian able to create the CLI socket for API commands.
This commit is contained in:
@@ -15,6 +15,12 @@ fi
|
|||||||
DEFAULT_VAULT_PATH="$(python /app/scripts/render_config.py | tail -n 1)"
|
DEFAULT_VAULT_PATH="$(python /app/scripts/render_config.py | tail -n 1)"
|
||||||
|
|
||||||
# Start a virtual X server for the official Obsidian desktop app.
|
# 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 "$DISPLAY" -screen 0 "${XVFB_SCREEN:-1280x1024x24}" -nolisten tcp >/tmp/xvfb.log 2>&1 &
|
||||||
XVFB_PID=$!
|
XVFB_PID=$!
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user