Repository navigation
Directory join: force the reboot the enforce flag asks for - #29
Merged
Merged
Conversation
A join asks for a reboot only when the host's "Enforce Hostname | AD Join Reboots" flag is set. The reason went to the coordinator unforced, so it waited for every logged-in user to leave. On a workstation nobody logs off, the join never finished. protocol-v1 says a capability's reason is forced when the enforce flag is set; this now matches it. A logged-in user still gets FOG_GRACE_TIMEOUT of warning. Seen on host 3163 (PW0HGF8S), 2026-10-13. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The previous commit forced every join reboot. Force now comes from the host's "Enforce Hostname | AD Join Reboots" flag, as the host page says: set, the client forces the reboot; unset, it waits until all users log off. Before this, an unset flag dropped the reboot request entirely, so the join never finished even on an empty machine. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A domain join with "Enforce Hostname | AD Join Reboots" set never rebooted while a user was logged in. The agent logged
reboot: pending_reboot (waiting for 2 logged-in user(s) to leave (directory: joined a domain; ...))every poll. Seen on host 3163 (PW0HGF8S).Cause
The server sends the host's enforce flag as the directory block's
reboot(DirectoryJoin.php,'reboot' => (bool)$Host->get('enforce')). The agent used it only to decide whether to ask for a reboot at all, and the reason it recorded was never forced.Fix
Report.Rebootnow means "the join needs a reboot". A newReport.Forcecarries the enforce flag.reportDirectoryrecords the reason withForce: r.Force.FOG_GRACE_TIMEOUTof warning. Enforce unset: the reboot waits until all users log off. Before, an unset flag dropped the reboot entirely.This matches the host page text and protocol-v1 ("forced if the host's enforce flag is set").
Note
A machine that already holds the unforced reason keeps it, and the update capability defers while any reboot is pending. So an affected machine gets this fix only after one manual restart, which also finishes its join.
Test
TestAJoinRebootFollowsTheEnforceFlagandTestConvergeForcesTheRebootOnlyUnderEnforcereplace the old permission test. Both go red with the force dropped.go test ./...andgo vet(linux, windows) pass.🤖 Generated with Claude Code