File size: 1,755 Bytes
1cb0c01
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# t19 entrypoint — vedit's start-editor with the crash supervisor FIXED for
# computer-1 (2026-09-03, t19 run a1): the base supervisor relaunched a
# crashed editor with DISPLAY=:0, but the harness's desktop is Xvfb :1, so
# every relaunch died with "Could not load the Qt platform plugin xcb"
# (6 failed relaunches in the opus sandbox's /var/log/editor-supervisor.log;
# the fable agent lost Friction in the Scene Properties colour dialog and
# never got it back). This version targets :1 when its socket exists, goes
# through the app's launcher (pulse null sink, GL env), and polls faster.
set -euo pipefail
mkdir -p /logs/verifier /root/edit /root/Desktop /root/.config/autostart
APP="${APP:-kdenlive}"
if [ "$APP" != "kdenlive" ] && [ -f "/opt/autostart/${APP}-autostart.desktop" ]; then
  rm -f /root/.config/autostart/kdenlive.desktop
  cp "/opt/autostart/${APP}-autostart.desktop" "/root/.config/autostart/${APP}.desktop"
fi
# GUI-only world (Sid, 2026-09-04): no terminal exists in the image. Relaunch
# routes are this supervisor (Friction) and the Thunar-backed Desktop icons
# (Friction, Tutorial 1/2).
(
  proc="$APP"; seen=0
  while true; do
    if pgrep -x "$proc" >/dev/null 2>&1; then
      seen=1
    elif [ "$seen" = 1 ]; then
      sleep 5
      if ! pgrep -x "$proc" >/dev/null 2>&1; then
        disp=":0"; [ -S /tmp/.X11-unix/X1 ] && disp=":1"
        echo "$(date -u +%H:%M:%S) supervisor: $proc gone, relaunching on $disp" >> /var/log/editor-supervisor.log
        DISPLAY="$disp" HOME=/root SDL_AUDIODRIVER=dummy QSG_RHI_BACKEND=opengl LIBGL_ALWAYS_SOFTWARE=1 \
          setsid -f "$proc" >> /var/log/editor-supervisor.log 2>&1 || true
        sleep 20
      fi
    fi
    sleep 10
  done
) &
exec sleep infinity