From cc5daaaf37b2f922fbfb982a781fba1564ddf99f Mon Sep 17 00:00:00 2001 From: Levi Woodard Date: Wed, 3 Jun 2026 00:04:50 +0000 Subject: [PATCH] status.sh: don't misreport an unreachable user bus as a missing unit Running status.sh in the first seconds after a reboot (before /run/user/$UID exists / the lingering user manager is reachable), or as the wrong user without a session bus, made every `systemctl --user` call fail with "Failed to connect to bus". The Service check read that the same as "unit doesn't exist" and printed a scary "no sunshine user unit found" for a perfectly healthy, auto-starting install. Probe the user manager once up front; if the bus is unreachable, say so explicitly (and point at 'ss -tulnp | grep 47990' to verify Sunshine independently) instead of cascading into false negatives. Co-Authored-By: Claude Opus 4.8 (1M context) --- status.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/status.sh b/status.sh index dc43879..e59428c 100755 --- a/status.sh +++ b/status.sh @@ -85,6 +85,16 @@ fi # ---- 2. service unit + state ------------------------------------------------ section "Service" +# Can we even reach the user's systemd manager? Every uctl call below depends on +# it. If the bus is unreachable, a healthy install looks identical to a missing +# one (`cat`/`is-active`/`is-enabled` all just fail) — the classic false alarm +# from running status.sh in the first seconds after reboot (before /run/user/$UID +# exists) or as the wrong user / without a session bus. Distinguish the two. +if ! uctl list-units --type=service >/dev/null 2>&1; then + fail "can't reach ${SUSER}'s user systemd manager (bus unavailable) — unit checks below are blind, NOT proof the service is missing" \ + "Run as $SUSER in a normal session (or 'sudo ./status.sh' once boot finishes). Right after reboot, /run/user/$UID_N may not exist yet — retry in a few seconds. Verify Sunshine independently: 'ss -tulnp | grep 47990'." + UNIT="" +else UNIT="" for u in sunshine.service app-dev.lizardbyte.app.Sunshine.service; do if uctl cat "$u" >/dev/null 2>&1; then UNIT=$u; break; fi @@ -147,6 +157,7 @@ else "Run 'systemctl --user status $UNIT' — move Requires=/After= into [Unit]. See TROUBLESHOOTING.md §12." fi fi +fi # end user-manager-reachable guard # ---- 3. config + capture backend -------------------------------------------- section "Config & capture backend"