Repository navigation
Conversation
ExecCondition skipped permanently when it raced bluetoothd at login, leaving the session with no pairing agent (omacom#13247). Co-authored-by: AnPod <AnPod@users.noreply.github.com>
7f91d34 to
6658680
Compare
bt-agent is a user unit, and the user manager has no bluetooth.service: it loads as not-found, so After= ordered against nothing and the test asserting the line guarded nothing. The ExecStartPre check plus Restart=on-failure is what waits for the system bluetoothd. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the bluetoothd check moved to ExecStartPre, starting bt-agent before bluetoothd is active fails the start job. enable-user-units.sh starts it under set -e, so on a first login racing bluetoothd it exited 1, failing the first-run step and skipping the owe theme-set hook after it. Start bt-agent with --no-block, so its own retries take over, and keep waiting on the other units so their failures still count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
|
Reviewed and reproduced on a worker VM. The fix works. I pushed two small corrections to your branch. Reproduction. Using a virtual HCI controller, I held Pushed:
Tests on the worker at b719dc0. One tradeoff for the maintainer. On a machine with an adapter where the user has deliberately disabled bluetoothd, the unit now logs a failed start every 2s instead of skipping once. Omarchy itself turns Bluetooth off with rfkill, which leaves bluetoothd running, so this only affects a hand-disabled service. Second opinion: Codex Medium, two rounds. The first round found the first-run failure above. The second round, on b719dc0, found nothing open beyond the tradeoff. That second round saw my results, so its agreement is not independent. This fixes #13247. It is waiting on the maintainer, and on the unrelated |
|
| # ExecCondition would skip permanently when it races bluetooth.service at | ||
| # login (#13247). Fail the start instead so Restart=on-failure retries until | ||
| # bluetoothd is up. | ||
| ExecStartPre=/usr/bin/systemctl is-active --quiet bluetooth.service |
There was a problem hiding this comment.
Repeated starts when Bluetooth stays down If a machine has a Bluetooth adapter but
bluetooth.service is masked or persistently failing, this check fails on every start attempt. The existing two-second restart interval then produces repeated failures and log entries instead of leaving the unit idle as ExecCondition did. Consider a backoff or a way to distinguish delayed startup from a service that will not start.
Knowledge Base Used: Desktop session and window management
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| grep -Fx 'ExecStartPre=/usr/bin/systemctl is-active --quiet bluetooth.service' "$service" >/dev/null | ||
| pass "bt-agent retries when bluetooth.service is not yet active" |
There was a problem hiding this comment.
Retry recovery remains untested This assertion checks that the pre-start command is present, but it does not test whether the agent starts after
bluetooth.service changes from inactive to active. A test of that transition would protect the race fix; the current test could pass even if recovery stopped working.
quattro now enables first-run's user units one at a time and exits non-zero if any failed. bt-agent comes out of that loop into its own call, still --no-block so its pre-start retry does not fail first-run, and still counted in the exit status if enabling it fails. --no-block goes before --now so first-run-test's parser, which reads each unit after "--user enable --now", is not handed two words. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bt-agent is enabled on its own line with --no-block ahead of --now, so the per-unit loop, which reads units after "--user enable --now", never covers it. Check it explicitly: first-run must report it and still enable everything else. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
Comments Outside DiffThese findings could not be posted inline.
|
|
The conflict. Reproduction at e5805eb. I used a virtual HCI controller, held Tests on the worker. Second opinion: Codex Medium, two rounds. The first round found the gap in Greptile's note on #14795 changes the comment block directly below the line this PR changes in This fixes #13247 and is waiting on the maintainer. |
|
Re-checked at e5805eb by Claude Opus 5.5, with Codex Medium and muse-wonder (pi, thinking high) as second opinions. Nothing was run this time: the head is the one tested on a worker on 11 October, and those results still hold. It no longer merges into This is one of four open fixes for the skip in #13247 and #8962, and it is the newest. The older ones are #9131 (30 August), #11937 (15 September) and #13258 (25 September). The older fix wins by default. This one doesn't take the place of #11937 or #13258, because both are older and both handle a case it doesn't. On a machine with the bluetooth module loaded but Second opinion. Both reviewers compared the four diffs without being told my answer. Both chose #11937 over this one, because it also replaces an agent left registered to a bluetoothd that has since restarted (#9965). Neither found anything here that the winner lacks. The first-run I haven't resolved the conflict, because the merge would only be needed if this fix were chosen. If the maintainer picks this one, the conflict is in Waiting on: the maintainer, to choose between the competing fixes. |
Summary
Fixes #13247
ExecConditionpermanently skippedbt-agent.servicewhen it racedbluetooth.serviceat login, leaving the session with no pairing agent.Change
bluetooth.serviceExecStartPre=systemctl is-activesoRestart=on-failureretries until bluetoothd is uptest/shell.d/systemd-test.shTest plan
bash test/shell.d/systemd-test.sh