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:
+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`)
|
||||
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
|
||||
|
||||
Deliberately placed under `gitea-workflow`'s **own home directory**, not under
|
||||
|
||||
Reference in New Issue
Block a user