fix: wine too much clients errors
This commit is contained in:
@@ -13,12 +13,10 @@ RUN dpkg --add-architecture i386 && \
|
|||||||
apt-get update && \
|
apt-get update && \
|
||||||
apt-get install -y --install-recommends \
|
apt-get install -y --install-recommends \
|
||||||
winehq-staging \
|
winehq-staging \
|
||||||
xvfb \
|
|
||||||
tcpdump \
|
tcpdump \
|
||||||
&& \
|
&& \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
RUN mkdir -p /tmp/.X11-unix && chmod 1777 /tmp/.X11-unix
|
|
||||||
|
|
||||||
WORKDIR /root
|
WORKDIR /root
|
||||||
|
|
||||||
|
|||||||
@@ -1,28 +1,20 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
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
|
# 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
|
# in this container, so point it at a valid (empty) directory to silence
|
||||||
# the "XDG_RUNTIME_DIR is invalid" errors.
|
# the "XDG_RUNTIME_DIR is invalid" errors.
|
||||||
export XDG_RUNTIME_DIR=/tmp/runtime-${SERVER_PORT}
|
export XDG_RUNTIME_DIR=/tmp/runtime-${SERVER_PORT}
|
||||||
mkdir -p "${XDG_RUNTIME_DIR}"
|
mkdir -p "${XDG_RUNTIME_DIR}"
|
||||||
|
|
||||||
# Clean up any stale X lock from a previous container run.
|
# Use Wine's headless (null) display driver — accServer.exe has no GUI so
|
||||||
rm -f /tmp/.X${DISPLAY_NUM}-lock /tmp/.X11-unix/X${DISPLAY_NUM} 2>/dev/null || true
|
# there is no need for Xvfb at all. This avoids the X11 client limit and
|
||||||
|
# removes the Xvfb process entirely.
|
||||||
# Raise Xvfb's client limit — Wine Staging opens more X11 connections than
|
export DISPLAY=
|
||||||
# the default 256, causing "Maximum number of clients reached" spam.
|
export WINEDLLOVERRIDES="winex11.drv="
|
||||||
Xvfb ${DISPLAY} -screen 0 1024x768x16 -nolisten tcp -maxclients 512 &
|
|
||||||
XVFB_PID=$!
|
|
||||||
|
|
||||||
cleanup() {
|
cleanup() {
|
||||||
echo "Stopping ACC server..."
|
echo "Stopping ACC server..."
|
||||||
kill $XVFB_PID 2>/dev/null || true
|
|
||||||
}
|
}
|
||||||
trap cleanup SIGTERM SIGINT
|
trap cleanup SIGTERM SIGINT
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user