From 6882eda03f491d6c08d7c34d9ed666495e62a68a Mon Sep 17 00:00:00 2001 From: Sluijsens Date: Wed, 29 Jul 2026 12:56:01 +0200 Subject: [PATCH] Adds systemd --user bus-connection troubleshooting Enabling lingering doesn't start the user manager retroactively, and sudo -u often drops XDG_RUNTIME_DIR - both produce the same "Failed to connect to bus" error when setting this up by hand. --- .../features/gitea-deployment-workflow/audit.md | 11 +++++++++++ .../deployment/deployment-instructions.md | 13 +++++++++++++ 2 files changed, 24 insertions(+) diff --git a/aidlc-docs/features/gitea-deployment-workflow/audit.md b/aidlc-docs/features/gitea-deployment-workflow/audit.md index 6adb0b0..63ef1ea 100644 --- a/aidlc-docs/features/gitea-deployment-workflow/audit.md +++ b/aidlc-docs/features/gitea-deployment-workflow/audit.md @@ -1356,3 +1356,14 @@ by Infrastructure Design. U5 carries REF-U3-01's Umami origin gate plus FR-21 an **Context**: OPERATIONS — Deployment Setup revealed a genuine Construction-phase technology gap; resolved with application code changes (not just documentation), verified against a real database --- +## Deployment Setup — systemd --user Bus Connection Troubleshooting + +**Timestamp**: 2026-07-29T00:10:00Z + +**User Input**: "Als ik systemctl --user daemon-reload uitvoer krijg ik de volgende fout \"Failed to connect to bus: No medium found\"" + +**AI Response**: "Explained the likely causes (lingering not yet enabled, user manager not started since enabling lingering doesn't retroactively start it, or running via sudo -u instead of a real login shell losing XDG_RUNTIME_DIR) and gave concrete fix commands. Added a troubleshooting note to deployment-instructions.md § 1.3 covering this exact error for future readers doing manual host setup before the deploy workflow ever runs." + +**Context**: OPERATIONS — Deployment Setup, host-setup troubleshooting captured in documentation + +--- diff --git a/aidlc-docs/features/gitea-deployment-workflow/operations/deployment/deployment-instructions.md b/aidlc-docs/features/gitea-deployment-workflow/operations/deployment/deployment-instructions.md index 4e1ec7a..7888513 100644 --- a/aidlc-docs/features/gitea-deployment-workflow/operations/deployment/deployment-instructions.md +++ b/aidlc-docs/features/gitea-deployment-workflow/operations/deployment/deployment-instructions.md @@ -65,6 +65,19 @@ common "Failed to connect to bus" error `systemctl --user` can throw when invoke non-interactive SSH command — lingering keeps the user's systemd instance (and `XDG_RUNTIME_DIR`) running independent of any login session. +**If `systemctl --user ...` still fails with `Failed to connect to bus: No medium found`** while +setting the rest of this up manually (before the deploy workflow ever runs): enabling lingering +does not retroactively start the user manager — that happens on the next real login, reboot, or +manually: +```bash +sudo systemctl start user@$(id -u gitea-workflow).service +``` +And run `systemctl --user` commands from a **real login shell** for that account +(`sudo -i -u gitea-workflow`), not `sudo -u gitea-workflow systemctl --user ...` from your own +session — the latter often doesn't carry `XDG_RUNTIME_DIR` along, which produces this exact error. +Verify with `loginctl show-user gitea-workflow | grep Linger` (expect `Linger=yes`) and +`ls /run/user/` (should exist once the user manager has actually started). + ### 1.4 Directory Skeleton Deliberately placed under `gitea-workflow`'s **own home directory**, not under