From dbb1cdd7249291fb21c249c3a28147822984c472 Mon Sep 17 00:00:00 2001 From: junkerderprovinz Date: Fri, 28 Aug 2026 20:46:03 +0200 Subject: [PATCH] Let SELKIES_DEBUG show the desktop session's output The session scripts sent their own output to /dev/null unconditionally, so autostart failures and the ready banner never reached the container log. SELKIES_DEBUG is documented but was not wired to anything. svc-de/run opens the destination while it is still root and both entrypoints inherit the descriptor across s6-setuidgid, so abc never opens /dev/stdout itself and the choice lives in one place instead of in each session script. --- root/defaults/startwm.sh | 5 +++-- root/defaults/startwm_wayland.sh | 8 ++++---- root/etc/s6-overlay/s6-rc.d/svc-de/run | 15 +++++++++++++-- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/root/defaults/startwm.sh b/root/defaults/startwm.sh index a1cb9d1..c126b4d 100755 --- a/root/defaults/startwm.sh +++ b/root/defaults/startwm.sh @@ -7,5 +7,6 @@ if which nvidia-smi > /dev/null 2>&1 && ls -A /dev/dri 2>/dev/null && [ "${DISAB export GALLIUM_DRIVER=zink fi -# Start DE -exec dbus-launch --exit-with-session /usr/bin/openbox-session > /dev/null 2>&1 +# Start DE. Output goes wherever svc-de/run pointed it, so SELKIES_DEBUG +# decides whether the session's own logs are kept. +exec dbus-launch --exit-with-session /usr/bin/openbox-session diff --git a/root/defaults/startwm_wayland.sh b/root/defaults/startwm_wayland.sh index fde82bb..c96b73a 100755 --- a/root/defaults/startwm_wayland.sh +++ b/root/defaults/startwm_wayland.sh @@ -28,7 +28,7 @@ if [ "${PELORUS,,}" == "true" ]; then kill $ATSPI_PID kill $LABWC_PID kill $PELORUS_PID - ' > /dev/null 2>&1 + ' else dbus-run-session bash -c ' /usr/libexec/at-spi2-registryd & @@ -38,11 +38,11 @@ if [ "${PELORUS,,}" == "true" ]; then labwc -i kill $ATSPI_PID kill $PELORUS_PID - ' > /dev/null 2>&1 + ' fi else if [ "${SELKIES_DESKTOP,,}" == "true" ]; then - labwc > /dev/null 2>&1 & + labwc & LABWC_PID=$! sleep 1 export WAYLAND_DISPLAY=wayland-0 @@ -50,6 +50,6 @@ else selkies-desktop kill $LABWC_PID else - labwc > /dev/null 2>&1 + labwc fi fi diff --git a/root/etc/s6-overlay/s6-rc.d/svc-de/run b/root/etc/s6-overlay/s6-rc.d/svc-de/run index 30f75ce..2f14a27 100755 --- a/root/etc/s6-overlay/s6-rc.d/svc-de/run +++ b/root/etc/s6-overlay/s6-rc.d/svc-de/run @@ -1,5 +1,16 @@ #!/usr/bin/with-contenv bash +# Where the desktop session's own output goes. Opened here, while this script +# is still root, so the descriptor is inherited across s6-setuidgid and the +# exec into startwm(_wayland).sh: abc never opens it itself. Both entrypoints +# below share it, so the choice lives in one place rather than in each session +# script. +if [[ "${SELKIES_DEBUG,,}" == "true" ]]; then + exec 3>&1 +else + exec 3>/dev/null +fi + # wayland entrypoint if [[ "${PIXELFLUX_WAYLAND,,}" == "true" ]]; then SOCKET_PATH="${XDG_RUNTIME_DIR}/${WAYLAND_DISPLAY:-wayland-1}" @@ -10,7 +21,7 @@ if [[ "${PIXELFLUX_WAYLAND,,}" == "true" ]]; then echo "[svc-de] ${SOCKET_PATH} found launching de" cd $HOME exec s6-setuidgid abc \ - /bin/bash /defaults/startwm_wayland.sh & + /bin/bash /defaults/startwm_wayland.sh >&3 2>&3 & PID=$! echo "$PID" > /de-pid wait "$PID" @@ -55,7 +66,7 @@ chmod 777 /tmp/selkies* # run cd $HOME exec s6-setuidgid abc \ - /bin/bash /defaults/startwm.sh & + /bin/bash /defaults/startwm.sh >&3 2>&3 & PID=$! echo "$PID" > /de-pid wait "$PID"