Bug 249163

Summary: /var/db/ntpd.leap-seconds.list is initialized with an expired file
Product: Base System Reporter: martin
Component: confAssignee: Philip Paeps <philip>
Status: Closed Overcome By Events    
Severity: Affects Only Me CC: emaste, philip
Priority: ---    
Version: 11.3-RELEASE   
Hardware: Any   
OS: Any   

Description martin 2020-09-07 10:16:08 UTC
I have just set up a 11.3-RELEASE-p13 VM with ntpd_enable="YES" in /etc/rc.conf and found that the mechanism for installing the first /var/db/ntpd.leap-seconds.list always installs an expired file (expires 28 December 2019).

The problem is in /etc/rc.d/ntpd: ntpd_precmd calls ntpd_init_leapfile, which copies the expired file /etc/ntp/leap-seconds to /var/db/ntpd.leap-seconds.list. Then, ntpd_fetch_leapfile is never called because /var/db/ntpd.leap-seconds.list exists.

As a result, ntpd gives these messages on startup:

Sep  4 18:09:27 test ntpd[3477]: ntpd 4.2.8p12-a (1): Starting
Sep  4 18:09:27 test ntpd[3477]: Command line: /usr/sbin/ntpd -c /etc/ntp.conf -p /var/run/ntpd.pid -f /var/db/ntpd.drift
Sep  4 18:09:27 test ntpd[3477]: ----------------------------------------------------
Sep  4 18:09:27 test ntpd[3477]: ntp-4 is maintained by Network Time Foundation,
Sep  4 18:09:27 test ntpd[3477]: Inc. (NTF), a non-profit 501(c)(3) public-benefit
Sep  4 18:09:27 test ntpd[3477]: corporation.  Support and training for ntp-4 are
Sep  4 18:09:27 test ntpd[3477]: available at https://www.nwtime.org/support
Sep  4 18:09:27 test ntpd[3477]: ----------------------------------------------------
Sep  4 18:09:27 test ntpd[3478]: leapsecond file ('/var/db/ntpd.leap-seconds.list'): good hash signature
Sep  4 18:09:27 test ntpd[3478]: leapsecond file ('/var/db/ntpd.leap-seconds.list'): loaded, expire=2019-12-28T00:00:00Z last=2017-01-01T00:00:00Z ofs=37
Sep  4 18:09:27 test ntpd[3478]: leapsecond file ('/var/db/ntpd.leap-seconds.list'): expired 252 days ago
Comment 1 Philip Paeps freebsd_committer freebsd_triage 2024-02-15 09:24:09 UTC
We're a little bit smarter about leap-seconds.list in newer releases.  This specific issue is overcome by events.