Read getent's exit code, not its wording (hq issue 213) #88

Merged
mesh-admin merged 1 commits from fix/getent-not-found-is-an-answer into main 2026-10-04 00:11:48 +00:00
Contributor

The controller's handover to a process (mesh-controller#253) stopped at its first resource on the control machine:

applying "mesh-controller.account": the user database did not answer about "mesh-controller", so nothing can be said about it: getent exited 2

LookUpUser already meant to read getent's exit code 2 as "no such user". It matched the text "exit status 2", but the host's own runner words that error "getent exited 2", so it never matched. The container kept serving, which is the safe outcome.

  • The runner now keeps the *exec.ExitError under the same words.
  • system.ExitCode reads the code from that, or from either wording, which test fakes use.
  • LookUpUser asks the code.

Tests: absent in both wordings, a real database failure stays an error, and a real getent for a missing user reads as absent. The wording test fails on main and passes here. The full suite passes.

The controller's handover to a process (mesh-controller#253) stopped at its first resource on the control machine: ``` applying "mesh-controller.account": the user database did not answer about "mesh-controller", so nothing can be said about it: getent exited 2 ``` `LookUpUser` already meant to read getent's exit code 2 as "no such user". It matched the text "exit status 2", but the host's own runner words that error "getent exited 2", so it never matched. The container kept serving, which is the safe outcome. - The runner now keeps the `*exec.ExitError` under the same words. - `system.ExitCode` reads the code from that, or from either wording, which test fakes use. - `LookUpUser` asks the code. Tests: absent in both wordings, a real database failure stays an error, and a real `getent` for a missing user reads as absent. The wording test fails on main and passes here. The full suite passes.
mesh-admin added 1 commit 2026-10-04 00:11:45 +00:00
A user that does not exist yet was matched as Go's 'exit status 2', while the host's runner says
'getent exited 2', so it read as a user database that did not answer: the controller's account was
never created and the handover to its process stopped there. The runner keeps the exit underneath
its words, and a caller asks the code.
mesh-admin merged commit 8c2e76f4c1 into main 2026-10-04 00:11:48 +00:00
mesh-admin deleted branch fix/getent-not-found-is-an-answer 2026-10-04 00:11:48 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: novox/mesh-host#88