Currently running : 12.0-RELEASE FreeBSD 12.0-RELEASE r341666 GENERIC arm64 on a Raspberry Pi 3+. I'm only a few steps in from the base image. At this point I'm configuring
Ran
Added the following lines to /etc/rc.conf as per the ntpd documentation:
The documentation states that if the system clock is off by more than 1000s when ntpd starts the daemon will fail. Adding
In my case ntpd is not correcting the system clock on reboot. Running
I can manually run
ntpd
because the RPi doesn't have a RTC and I need it to have accurate time.Ran
pkg install ntpd
and the installation completed successfully. Added the following lines to /etc/ntp.conf:
Code:
server 0.north-america.pool.ntp.org iburst
server 1.north-america.pool.ntp.org iburst
server 2.north-america.pool.ntp.org iburst
server 3.north-america.pool.ntp.org iburst
#restricted because I only want this machine to check time and correct the clock, not serve time
restrict default ignore
Added the following lines to /etc/rc.conf as per the ntpd documentation:
Code:
ntpd_program="/usr/local/sbin/ntpd"
ntpdate_program="/usr/local/sbin/ntpdate"
ntpd_enable="YES"
ntpd_sync_on_start="YES"
The documentation states that if the system clock is off by more than 1000s when ntpd starts the daemon will fail. Adding
ntpd_sync_on_start="YES"
to rc.conf runs the daemon once with -g which forces a sync no matter the time difference.In my case ntpd is not correcting the system clock on reboot. Running
date
shows the system clock to be off by about 10 minutes After a couple hours uptime the clock is off by the same amount. No apparent errors in /var/log/messages, only the following:
Code:
Dec 30 02:20:14 BSDTor kernel: Security policy loaded: MAC/ntpd (mac_ntpd)
Dec 30 02:20:15 BSDTor ntpd[954]: ntpd 4.2.8p12@1.3728-o Tue Dec 18 20:41:39 UTC 2018 (1): Starting
Dec 30 02:20:15 BSDTor ntpd[955]: leapsecond file ('/var/db/ntpd.leap-seconds.list'): good hash signature
Dec 30 02:20:15 BSDTor ntpd[955]: leapsecond file ('/var/db/ntpd.leap-seconds.list'): loaded, expire=2017-12-28T00:00:00Z last=2017-01-01T00:00:00Z ofs=37
Dec 30 02:20:15 BSDTor ntpd[955]: leapsecond file ('/var/db/ntpd.leap-seconds.list'): expired less than 368 days ago
I can manually run
ntpdate -u pool.ntp.org
or stop ntpd and run ntpd -gq
manually then restart ntpd but this only works for the current session. If the server gets rebooted how can I be sure it will sync the time, since ntpd_syc_on_start doesn't seem to be working, and how can I make ntpd_syc_on_start work as advertised?