From 54cc91e4163492515f3ac3a46388c4b035e402b4 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 openbox and labwc output to /dev/null unconditionally, so autostart failures never reached the container log. SELKIES_DEBUG only affected the selkies server's own logging. svc-de/run opens fd 3 while it is still root, pointing at stdout when SELKIES_DEBUG is true and at /dev/null otherwise, and the session commands write to it. abc inherits the descriptor across s6-setuidgid and never opens /dev/stdout itself. The scripts fall back to /dev/null when fd 3 is missing, so running them without svc-de/run behaves as before. --- root/defaults/startwm.sh | 7 +++++-- root/defaults/startwm_wayland.sh | 11 +++++++---- root/etc/s6-overlay/s6-rc.d/svc-de/run | 8 ++++++++ 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/root/defaults/startwm.sh b/root/defaults/startwm.sh index ffeb3882..bd6f4fe0 100755 --- a/root/defaults/startwm.sh +++ b/root/defaults/startwm.sh @@ -1,12 +1,15 @@ #!/usr/bin/env bash +# fd 3 is opened by svc-de/run and follows SELKIES_DEBUG, stay quiet without it +[ -e /proc/self/fd/3 ] || exec 3>/dev/null + # Start DE if [ "${SELKIES_DESKTOP,,}" == "true" ]; then - exec dbus-launch --exit-with-session /usr/bin/openbox-session > /dev/null 2>&1 & + exec dbus-launch --exit-with-session /usr/bin/openbox-session >&3 2>&3 & OPENBOX_PID=$! sleep 1 selkies-desktop kill $OPENBOX_PID else - exec dbus-launch --exit-with-session /usr/bin/openbox-session > /dev/null 2>&1 + exec dbus-launch --exit-with-session /usr/bin/openbox-session >&3 2>&3 fi diff --git a/root/defaults/startwm_wayland.sh b/root/defaults/startwm_wayland.sh index 6526aa2e..19566b77 100755 --- a/root/defaults/startwm_wayland.sh +++ b/root/defaults/startwm_wayland.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash +# fd 3 is opened by svc-de/run and follows SELKIES_DEBUG, stay quiet without it +[ -e /proc/self/fd/3 ] || exec 3>/dev/null + # Start DE ulimit -c 0 export XCURSOR_THEME=breeze_cursors @@ -28,7 +31,7 @@ if [ "${PELORUS,,}" == "true" ]; then kill $ATSPI_PID kill $LABWC_PID kill $PELORUS_PID - ' > /dev/null 2>&1 + ' >&3 2>&3 else dbus-run-session bash -c ' /usr/libexec/at-spi2-registryd & @@ -38,11 +41,11 @@ if [ "${PELORUS,,}" == "true" ]; then labwc kill $ATSPI_PID kill $PELORUS_PID - ' > /dev/null 2>&1 + ' >&3 2>&3 fi else if [ "${SELKIES_DESKTOP,,}" == "true" ]; then - labwc > /dev/null 2>&1 & + labwc >&3 2>&3 & LABWC_PID=$! sleep 1 export WAYLAND_DISPLAY=wayland-0 @@ -50,6 +53,6 @@ else selkies-desktop kill $LABWC_PID else - labwc > /dev/null 2>&1 + labwc >&3 2>&3 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 d68cbd3b..2cd2b725 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,13 @@ #!/usr/bin/with-contenv bash +# session output goes to fd 3, opened here while still root because abc +# cannot open /dev/stdout itself but inherits the descriptor +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}"