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"