File size: 870 Bytes
2e7de11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh
set -eu
export FRICTION_AUDIT_MODE=1
export LD_LIBRARY_PATH=/opt/friction/lib
export QT_QPA_PLATFORM=xcb
export QT_PLUGIN_PATH=/opt/friction/plugins
export LIBGL_ALWAYS_SOFTWARE=1
export XDG_RUNTIME_DIR=/tmp/xdg-friction-audit
export DISPLAY=:99
mkdir -p "$XDG_RUNTIME_DIR" /root/.config /root/.cache
chmod 700 "$XDG_RUNTIME_DIR"
# A private container has no other display clients; bind only its local socket.
# Avoid xvfb-run's parent USR1 readiness handshake when the shell is PID1.
Xvfb "$DISPLAY" -screen 0 1920x1080x24 -nolisten tcp -ac >/tmp/xvfb-audit.log 2>&1 &
TASK_XVFB_PID=$!
trap 'kill "$TASK_XVFB_PID" 2>/dev/null || true' EXIT INT TERM
TASK_READY=0
while [ ! -S /tmp/.X11-unix/X99 ]; do
 TASK_READY=$((TASK_READY+1))
 if [ "$TASK_READY" -gt 50 ]; then cat /tmp/xvfb-audit.log >&2; exit 5; fi
 sleep 0.1
done
/opt/friction-audit/bin/friction "$@"