Browse Source

Fix KasmVNC

Seungmin Kim 1 năm trước cách đây
mục cha
commit
5372f5e4bc
2 tập tin đã thay đổi với 11 bổ sung0 xóa
  1. 3 0
      kasmvnc-entrypoint.sh
  2. 8 0
      supervisord.conf

+ 3 - 0
kasmvnc-entrypoint.sh

@@ -66,6 +66,9 @@ if [ "$(echo ${SELKIES_ENABLE_RESIZE} | tr '[:upper:]' '[:lower:]')" = "true" ];
 if [ "$(echo ${SELKIES_ENABLE_BASIC_AUTH} | tr '[:upper:]' '[:lower:]')" = "false" ]; then export NO_KASM_AUTH_FLAG="-disableBasicAuth"; fi
 if [ -n "${KASMVNC_VIEWPASS}" ]; then (echo "${KASMVNC_VIEWPASS}"; echo "${KASMVNC_VIEWPASS}";) | kasmvncpasswd -u "view"; fi
 
+# Wait for X server to start
+echo 'Waiting for X Socket' && until [ -S "/tmp/.X11-unix/X${DISPLAY#*:}" ]; do sleep 0.5; done && echo 'X Server is ready'
+
 # Run KasmVNC
 kasmvncserver "${KASM_DISPLAY}" -geometry "${DISPLAY_SIZEW}x${DISPLAY_SIZEH}" -depth "${DISPLAY_CDEPTH}" -noxstartup -FrameRate "${DISPLAY_REFRESH}" -websocketPort 8081 -AlwaysShared -BlacklistTimeout 0 ${NO_KASM_AUTH_FLAG}
 

+ 8 - 0
supervisord.conf

@@ -8,6 +8,7 @@ chmod=0700
 
 [supervisord]
 logfile=/tmp/supervisord.log
+logfile_maxbytes=5MB
 logfile_backups=0
 loglevel=info
 pidfile=/tmp/supervisord.pid
@@ -27,6 +28,7 @@ files = /etc/supervisor/conf.d/*.conf
 [program:entrypoint]
 command=bash -c "dbus-run-session -- /etc/entrypoint.sh"
 stdout_logfile=/tmp/entrypoint.log
+stdout_logfile_maxbytes=5MB
 stdout_logfile_backups=0
 redirect_stderr=true
 stopasgroup=true
@@ -38,6 +40,7 @@ priority=1
 [program:selkies-gstreamer]
 command=bash -c "if [ $(echo %(ENV_KASMVNC_ENABLE)s | tr '[:upper:]' '[:lower:]') != true ]; then /etc/selkies-gstreamer-entrypoint.sh; else sleep infinity; fi"
 stdout_logfile=/tmp/selkies-gstreamer-entrypoint.log
+stdout_logfile_maxbytes=5MB
 stdout_logfile_backups=0
 redirect_stderr=true
 stopasgroup=true
@@ -49,6 +52,7 @@ priority=20
 [program:kasmvnc]
 command=bash -c "if [ $(echo %(ENV_KASMVNC_ENABLE)s | tr '[:upper:]' '[:lower:]') = true ]; then /etc/kasmvnc-entrypoint.sh; else sleep infinity; fi"
 stdout_logfile=/tmp/kasmvnc-entrypoint.log
+stdout_logfile_maxbytes=5MB
 stdout_logfile_backups=0
 redirect_stderr=true
 stopasgroup=true
@@ -60,6 +64,7 @@ priority=20
 [program:nginx]
 command=bash -c "until head -n 1 /etc/nginx/sites-available/default | grep -q 'Selkies'; do sleep 0.5; done; /usr/sbin/nginx -g \"daemon off;\""
 stdout_logfile=/tmp/nginx.log
+stdout_logfile_maxbytes=5MB
 stdout_logfile_backups=0
 redirect_stderr=true
 stopasgroup=true
@@ -76,6 +81,7 @@ priority=10
 command=bash -c "until [ -S \"/tmp/.X11-unix/X${DISPLAY#*:}\" ]; do sleep 0.5; done; /usr/bin/pipewire"
 environment=PIPEWIRE_LATENCY="32/48000",DISPLAY=":0",DISABLE_RTKIT="y",XDG_RUNTIME_DIR="%(ENV_XDG_RUNTIME_DIR)s",PIPEWIRE_RUNTIME_DIR="%(ENV_XDG_RUNTIME_DIR)s",PULSE_RUNTIME_PATH="%(ENV_XDG_RUNTIME_DIR)s/pulse"
 stdout_logfile=/tmp/pipewire.log
+stdout_logfile_maxbytes=5MB
 stdout_logfile_backups=0
 redirect_stderr=true
 stopasgroup=true
@@ -87,6 +93,7 @@ autorestart=true
 command=bash -c "until [ \"$(echo ${XDG_RUNTIME_DIR}/pipewire-*.lock)\" != \"${XDG_RUNTIME_DIR}/pipewire-*.lock\" ]; do sleep 0.5; done; /usr/bin/wireplumber"
 environment=PIPEWIRE_LATENCY="32/48000",DISPLAY=":0",DISABLE_RTKIT="y",XDG_RUNTIME_DIR="%(ENV_XDG_RUNTIME_DIR)s",PIPEWIRE_RUNTIME_DIR="%(ENV_XDG_RUNTIME_DIR)s",PULSE_RUNTIME_PATH="%(ENV_XDG_RUNTIME_DIR)s/pulse"
 stdout_logfile=/tmp/wireplumber.log
+stdout_logfile_maxbytes=5MB
 stdout_logfile_backups=0
 redirect_stderr=true
 stopasgroup=true
@@ -98,6 +105,7 @@ autorestart=true
 command=bash -c "until [ \"$(echo ${XDG_RUNTIME_DIR}/pipewire-*.lock)\" != \"${XDG_RUNTIME_DIR}/pipewire-*.lock\" ]; do sleep 0.5; done; /usr/bin/pipewire-pulse"
 environment=PIPEWIRE_LATENCY="32/48000",DISPLAY=":0",DISABLE_RTKIT="y",XDG_RUNTIME_DIR="%(ENV_XDG_RUNTIME_DIR)s",PIPEWIRE_RUNTIME_DIR="%(ENV_XDG_RUNTIME_DIR)s",PULSE_RUNTIME_PATH="%(ENV_XDG_RUNTIME_DIR)s/pulse"
 stdout_logfile=/tmp/pipewire-pulse.log
+stdout_logfile_maxbytes=5MB
 stdout_logfile_backups=0
 redirect_stderr=true
 stopasgroup=true