Repository navigation
feat(ntp): one-shot sync and Registry-configurable NTP servers (#26) - #697
Merged
Merged
Conversation
- ntpd: `ntpd once` (or -q/--once) performs a single sync and exits (the `ntpdate` role) instead of only running the periodic daemon. - gen-hiv: default Ntpd\Parameters\Servers = pool.ntp.org;time.cloudflare.com; time.google.com (fallbacks live in configuration, not code) so first sync is reliable behind NAT. - docs: userland.md section 3.6. The SNTP client itself (libntp: request/reply parse, offset/delay, civil time; 19/19 host unit tests) and the periodic daemon (ob_set_datetime, Interval/ Timeout/Enabled) were already implemented. Verified: QEMU 953/953; VirtualBox (NAT, e1000): `ntpd once` -> 'synced: offset=198ms delay=0ms stratum=2', 'one-shot sync complete'; the auto-started daemon also synced (offset=1520ms).
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.
Fixes #26.
Status before this PR
The SNTP client was already implemented:
libntp— request build + reply parse (mode/stratum/KoD/originate checks), offset/delay, civil-time conversion; 19/19 host unit tests.ntpddaemon — DNS resolve, UDP exchange,ob_set_datetime(), periodic sync (Interval/Timeout/Enabled), status published to Registry.Missing vs the issue's architecture: a one-shot tool (
ntpdate) and reliable defaults.Changes
ntpd once(-q/--once) performs a single synchronization and exits (0 synced, 1 not) — thentpdaterole, reusing the daemon rather than a duplicated binary.gen-hiv: defaultNtpd\Parameters\Servers = pool.ntp.org;time.cloudflare.com;time.google.com. Fallbacks live in configuration, not hardcoded.userland.md3.6.VirtualBox evidence (NAT, e1000, guest 10.0.2.15)
The auto-started daemon also synced (
offset=1520ms). QEMUneodev test: 953/953.