Fix bug preventing input after the first startup of the container

Xorg was starting before udev could finish the monitor command. This prevented the X server from having access to the input devices. For some reason, any subsequent starts would be fine.

Adding a small delay to the X server start and triggering a request for device events from the kernel after a delay seems to fix this issue.
This commit is contained in:
Josh.5
2022-10-06 22:26:50 +13:00
parent 93fb8f858c
commit 54911cb97b
12 changed files with 122 additions and 36 deletions

View File

@@ -42,3 +42,5 @@ if [[ -e /dev/uinput ]]; then
echo "**** Ensure the default user has permission to r/w on input devices ****";
chmod 0666 /dev/uinput
fi
echo "DONE"

View File

@@ -1,8 +1,8 @@
# Fech NVIDIA GPU device (if one exists)
if [ "$NVIDIA_VISIBLE_DEVICES" == "all" ]; then
if [ "${NVIDIA_VISIBLE_DEVICES:-}" == "all" ]; then
export gpu_select=$(nvidia-smi --format=csv --query-gpu=uuid 2> /dev/null | sed -n 2p)
elif [ -z "$NVIDIA_VISIBLE_DEVICES" ]; then
elif [ -z "${NVIDIA_VISIBLE_DEVICES:-}" ]; then
export gpu_select=$(nvidia-smi --format=csv --query-gpu=uuid 2> /dev/null | sed -n 2p)
else
export gpu_select=$(nvidia-smi --format=csv --id=$(echo "$NVIDIA_VISIBLE_DEVICES" | cut -d ',' -f1) --query-gpu=uuid | sed -n 2p)

View File

@@ -1,8 +1,8 @@
# Fech NVIDIA GPU device (if one exists)
if [ "$NVIDIA_VISIBLE_DEVICES" == "all" ]; then
if [ "${NVIDIA_VISIBLE_DEVICES:-}" == "all" ]; then
export gpu_select=$(nvidia-smi --format=csv --query-gpu=uuid 2> /dev/null | sed -n 2p)
elif [ -z "$NVIDIA_VISIBLE_DEVICES" ]; then
elif [ -z "${NVIDIA_VISIBLE_DEVICES:-}" ]; then
export gpu_select=$(nvidia-smi --format=csv --query-gpu=uuid 2> /dev/null | sed -n 2p)
else
export gpu_select=$(nvidia-smi --format=csv --id=$(echo "$NVIDIA_VISIBLE_DEVICES" | cut -d ',' -f1) --query-gpu=uuid | sed -n 2p)

View File

@@ -4,7 +4,8 @@ priority=30
autostart=false
autorestart=true
user=%(ENV_USER)s
command=/usr/bin/x11vnc -display %(ENV_DISPLAY)s -rfbport %(ENV_PORT_VNC)s -shared -forever
command=/usr/bin/start-x11vnc.sh
environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s",DISPLAY="%(ENV_DISPLAY)s",PORT_VNC="%(ENV_PORT_VNC)s"
stopsignal=INT
stdout_logfile=/home/%(ENV_USER)s/.cache/log/x11vnc.log
stdout_logfile_maxbytes=10MB
@@ -18,7 +19,6 @@ priority=30
autostart=false
autorestart=true
user=%(ENV_USER)s
# /opt/noVNC/utils/launch.sh --vnc localhost:${PORT_VNC} --listen ${PORT_NOVNC_SERVICE}
command=/opt/noVNC/utils/launch.sh --vnc localhost:%(ENV_PORT_VNC)s --listen %(ENV_PORT_NOVNC_SERVICE)s
environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s"
stopsignal=INT

View File

@@ -4,7 +4,7 @@ priority=20
autostart=false
autorestart=true
user=root
command=/usr/bin/Xorg -ac -noreset -novtswitch -sharevts -dpi "%(ENV_DISPLAY_DPI)s" +extension "GLX" +extension "RANDR" +extension "RENDER" vt7 "%(ENV_DISPLAY)s"
command=/usr/bin/start-xorg.sh
environment=DISPLAY="%(ENV_DISPLAY)s",DISPLAY_DPI="%(ENV_DISPLAY_DPI)s",XDG_RUNTIME_DIR="%(ENV_XDG_RUNTIME_DIR)s"
stopsignal=INT
stdout_logfile=/home/%(ENV_USER)s/.cache/log/xorg.log