I'm trying to use ntpd(8) to set the correct time on a machine.
I have setup the service by adding these two lines in /etc/rc.conf:
Then i ran
The thing I can't figure out is how to see that the time has been successfully synchronized with an NTP server.
I have checked the log file /var/log/messages but the closest thing I can find there is the ntpd(8) daemon starting successfully; not that it has synchronized its time.
I also tried using the ntpq(8) program.
What I want is a command or log file saying something like:
Is there such a command? Just so it's clear that the time has been updated.
I have setup the service by adding these two lines in /etc/rc.conf:
Code:
ntpd_enable="YES"
ntpd_sync_on_start="YES"
service ntpd start
to start the service.The thing I can't figure out is how to see that the time has been successfully synchronized with an NTP server.
I have checked the log file /var/log/messages but the closest thing I can find there is the ntpd(8) daemon starting successfully; not that it has synchronized its time.
I also tried using the ntpq(8) program.
Code:
mschultz@rpi3-bsd:~ % ntpq -c apeers
remote refid assid st t when poll reach delay offset jitter
==============================================================================
*10.1.23.5 c23ac814 50747 2 u 49 64 377 0.596 -0.390 0.070
Code:
mschultz@rpi3-bsd:~ % ntpq -c "pstats 50747"
associd=50747 status=961a conf, reach, sel_sys.peer, 1 event, sys_peer,
remote host: 10.1.23.5:123
local address: 10.1.23.90:123
time last received: 24
time until next send: 42
reachability change: 6008
packets sent: 127
packets received: 124
bad authentication: 0
bogus origin: 0
duplicate: 0
bad dispersion: 0
bad reference time: 0
candidate order: 6
What I want is a command or log file saying something like:
Local time successfully set to 'Sat Apr 23 10:44:21 CEST 2022' by NTP server 10.1.23.5. Time corrected by -0.390 seconds.
(just as an example)Is there such a command? Just so it's clear that the time has been updated.