nptd

It's actually 10:02 PM on October 25, but the computer thinks it's four hours later:
Code:
michael@freebsd:/var/log % date
Wed Oct 26 02:03:23 EDT 2016
michael@freebsd:/var/log %
I think that means that the BIOS is set to UTC, but the computer thinks it's set to EDT.

I thought that maybe ntpd would solve this issue, but I can't even tell if ntpd is running.

It looks like it started when I rebooted:
Code:
michael@freebsd:/var/log % grep ntpd messages
Oct 26 01:13:06 freebsd michael: /etc/rc.d/ntpd: WARNING: failed to start ntpd
Oct 26 01:42:33 freebsd ntpd[967]: ntpd 4.2.8p8-a (1): Starting
Oct 26 01:42:33 freebsd ntpd[968]: leapsecond file ('/var/db/ntpd.leap-seconds.list'): good hash signature
Oct 26 01:42:33 freebsd ntpd[968]: leapsecond file ('/var/db/ntpd.leap-seconds.list'): loaded, expire=2017-06-01T00:00:00Z last=2017-01-01T00:00:00Z ofs=37
michael@freebsd:/var/log %
But I don't see it running:
Code:
michael@freebsd:/var/log % ps aux | grep ntp
michael    2263   0.0  0.0  14796   2496  0  S+   03:14     0:00.00 grep ntp
michael@freebsd:/var/log % sudo ps aux | grep ntp
Password:
michael    2265   0.0  0.0  14796   2496  0  S+   03:14     0:00.00 grep ntp
michael@freebsd:/var/log %
service says it's enabled:
Code:
michael@freebsd:/var/log % service -e
/etc/rc.d/hostid
/etc/rc.d/hostid_save
//...
/etc/rc.d/ntpd
//...
 
I think ntpd exits if the time difference is too high for it to correct. In that case try ntpdate -u pool.ntp.org which would set the time in a large jump.
 
I think ntpd exits if the time difference is too high for it to correct. In that case try ntpdate -u pool.ntp.org which would set the time in a large jump.

-u just uses an unprivileged port so you don't have to stop ntpd first. -b forces the time to be set immediately instead of in slow increments (which can take days or weeks!).
 
Thanks for all the answers. Poking around on the web, it looks like timedatectl is recommended over ntpdate. Does that make sense?
 
I had incorrectly dates and times using ntpdate as server and as client.
I've changed to openntpd and everything works great.
 
Basically, ntpd is the daemon and ntpdate is the interactive application. If you don't want to run a daemon all the time, ntpdate can be run manually or as a cronjob to update the time. I think that in this case, the config file for ntpd had an option set for the maximum time jump that it would allow. Because ntpdate does not read the ntpd.conf file, there was no option set and thus it was allowed to jump the clock four hours.

For future reference, that option in ntpd.conf is panic and it's in seconds. If you set it to 0 it will disable the function and will allow ntpd to change the system clock by any amount.
 
Just fixed that for myself. It actually included 2 steps: set up timezone correctly, then set up ntpd with these two rc.conf options:
Code:
ntpd_enable="YES"
ntpd_sync_on_start="YES"
Then editing /etc/ntp.conf (not /etc/ntpd.conf !) proved to be optional, the only thing I changed there was about the leap file location.
 
Back
Top