12 Commits

Author SHA1 Message Date
Ami Fischman 294c93fa17 cmd/ntp: preserve system time in /perm across reboots (#359)
Why? Reduce the wall time during which the system believes it's 1970.
Makes syslog timestamps more sensible.
2026-01-23 10:40:04 +01:00
Berk D. Demir 7acb85f429 ntp: Allow alternative NTP servers as arguments (#244)
When the gokrazy deployment doesn't have internet access and the network
lacks NTP traffic re-routing to the local time servers, instances may
either have downright wrong clock (e.g. Raspberry Pi with no RTC) or
experience divergence due to drift.

This add the ability to override the default NTP Pool Vendor Zone for
gokrazy with servers supplied as command line arguments.

e.g.
```
    "PackageConfig": {
        "github.com/gokrazy/gokrazy/cmd/ntp": {
            "CommandLineFlags": [
                "time1.local",
                "time2.local",
                "10.1.2.123"
            ]
        }
    }
```
2024-01-18 08:20:56 +01:00
Michael Stapelberg fb63ef71df ntp: remove go1.9 stubs, we are at go1.19 2023-01-15 15:24:43 +01:00
Michael Stapelberg 77d1e48813 ntp: randomly select a pool address every time
In particular, only pool 2.gokrazy.pool.ntp.org has IPv6 addresses, so this
fixes setting the time via NTP in IPv6-only environments.
2023-01-15 15:18:33 +01:00
Michael Stapelberg 26498e13c5 ntp: also apply jitter when setting the time failed
for friendlier backoff behavior
2023-01-15 15:18:13 +01:00
Michael Stapelberg 9250323c5f use Go 1.17 in GitHub Actions 2021-08-18 09:57:24 +02:00
Michael Stapelberg 546057ad9b ntp: log a message after setting the clock
related to https://github.com/gokrazy/tools/issues/15
2020-06-21 07:42:00 +02:00
Michael Stapelberg 6c059494af ntp: set real-time clock (hwclock) if present 2018-06-13 23:51:31 +02:00
Michael Stapelberg 3ed1e381b5 ntp: drop privileges to nobody/nogroup, retain CAP_SYS_TIME 2017-09-03 22:21:00 +02:00
Michael Stapelberg 83adedae5d ntp: use gokrazy vendor zone
fixes #34
2017-08-25 09:24:15 +02:00
Michael Stapelberg eb8f1753b3 ntp: react to breaking API change
See https://github.com/beevik/ntp/pull/14
2017-08-23 09:51:01 +02:00
Michael Stapelberg 38af7fd18d Initial commit 2017-03-04 11:22:48 +01:00