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.
This commit is contained in:
@@ -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
|
**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
|
||||||
|
|
||||||
|
---
|
||||||
|
|||||||
+13
@@ -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`)
|
non-interactive SSH command — lingering keeps the user's systemd instance (and `XDG_RUNTIME_DIR`)
|
||||||
running independent of any login session.
|
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/<uid>` (should exist once the user manager has actually started).
|
||||||
|
|
||||||
### 1.4 Directory Skeleton
|
### 1.4 Directory Skeleton
|
||||||
|
|
||||||
Deliberately placed under `gitea-workflow`'s **own home directory**, not under
|
Deliberately placed under `gitea-workflow`'s **own home directory**, not under
|
||||||
|
|||||||
Reference in New Issue
Block a user