YipYup / docker-gpsd-ntpd

GPSd inside docker
GNU Affero General Public License v3.0
4 stars 1 forks source link

NTPd: Investigate significance of basedate messages when NTPd starts #8

Open YipYup opened 1 year ago

YipYup commented 1 year ago
[2023/02/28 22:52:56][ntpd] 28 Feb 22:52:56 ntpd[212]: basedate set to 2020-09-11
[2023/02/28 22:52:56][ntpd] 28 Feb 22:52:56 ntpd[212]: gps base set to 2020-09-13 (week 2123)
YipYup commented 1 year ago

basedate date

source: https://doc.ntp.org/documentation/4.2.8-series/miscopt/

Set NTP and GPS era anchor. date is either a date in ISO8601 format (YYYY-MM-DD) or an integer giving the days since 1900-01-01, the start of the NTP epoch. ntpd will clamp the system time to an era starting with the begin of this this day (00:00:00Z), covering a range of 232 seconds or roughly 136 years. The lowest accepted value is effectively 1970-01-02.

The GPS era base is the next Sunday on or following the base date, but obviously not before 1980-01-06. GPS time stamps are mapped into the 1024 weeks following the GPS base.

The default value is derived from the repository or build time stamp, minus 11 days. 1970-01-02 was chosen as lower bound so the local time is always after 1970-01-01,00:00. Some systems get into trouble if this is not the case.

ATTENTION: If the system clock is before the effective (implied or specific) basedate, the system clock will be set to the base date once and immediately when ntpd starts. This helps systems that have lost time completely to recover. Though not noticeable under normal conditions, it can happen. Check the logs if starting ntpd causes sudden clock moves.

YipYup commented 1 year ago

Perhaps it is possible to cause the value for basedate to be more current than what is in the repository for ntpd. Maybe it can be pulled from the fake-hwclock file?

YipYup commented 1 year ago
# cat /etc/fake-hwclock.data
2023-03-04 22:14:35