From fea9f9c67701e43681add0eca6bbb97743ee99a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=20Jurmanovi=C4=87?= Date: Tue, 31 Mar 2026 19:29:42 +0200 Subject: [PATCH] fix: wine too much clients errors --- docker/acc-server/Dockerfile | 2 -- docker/acc-server/entrypoint.sh | 18 +++++------------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/docker/acc-server/Dockerfile b/docker/acc-server/Dockerfile index 68c267e..7930274 100644 --- a/docker/acc-server/Dockerfile +++ b/docker/acc-server/Dockerfile @@ -13,12 +13,10 @@ RUN dpkg --add-architecture i386 && \ apt-get update && \ apt-get install -y --install-recommends \ winehq-staging \ - xvfb \ tcpdump \ && \ rm -rf /var/lib/apt/lists/* -RUN mkdir -p /tmp/.X11-unix && chmod 1777 /tmp/.X11-unix WORKDIR /root diff --git a/docker/acc-server/entrypoint.sh b/docker/acc-server/entrypoint.sh index 1724369..82d7af9 100644 --- a/docker/acc-server/entrypoint.sh +++ b/docker/acc-server/entrypoint.sh @@ -1,28 +1,20 @@ #!/bin/bash set -e -# Use a display number derived from the server port to avoid conflicts -# between containers (each server gets its own unique display). -DISPLAY_NUM=$((SERVER_PORT % 1000 + 100)) -export DISPLAY=:${DISPLAY_NUM} - # Wine Staging looks for PulseAudio via XDG_RUNTIME_DIR. There is no audio # in this container, so point it at a valid (empty) directory to silence # the "XDG_RUNTIME_DIR is invalid" errors. export XDG_RUNTIME_DIR=/tmp/runtime-${SERVER_PORT} mkdir -p "${XDG_RUNTIME_DIR}" -# Clean up any stale X lock from a previous container run. -rm -f /tmp/.X${DISPLAY_NUM}-lock /tmp/.X11-unix/X${DISPLAY_NUM} 2>/dev/null || true - -# Raise Xvfb's client limit — Wine Staging opens more X11 connections than -# the default 256, causing "Maximum number of clients reached" spam. -Xvfb ${DISPLAY} -screen 0 1024x768x16 -nolisten tcp -maxclients 512 & -XVFB_PID=$! +# Use Wine's headless (null) display driver — accServer.exe has no GUI so +# there is no need for Xvfb at all. This avoids the X11 client limit and +# removes the Xvfb process entirely. +export DISPLAY= +export WINEDLLOVERRIDES="winex11.drv=" cleanup() { echo "Stopping ACC server..." - kill $XVFB_PID 2>/dev/null || true } trap cleanup SIGTERM SIGINT