Solved Problem with VPS Time [1 hour behind]



Reaction score: 5
Messages: 79


A FreeBSD VPS has the TZ set at exactly 1 hour behind and I can't tell exactly why.

Se below:

root@localhost:/root # dmesg | grep Timecounter
Timecounter "HPET" frequency 100000000 Hz quality 950
Timecounter "ACPI-fast" frequency 3579545 Hz quality 900
Timecounter "i8254" frequency 1193182 Hz quality 0
Timecounters tick every 10.000 msec
Timecounter "TSC-low" frequency 1100017316 Hz quality 800

Tried every option. All of them lag 1 hour behind UTC. I tried using tzsetup and cp to set time to UTC. Still one hour behind.

Then I noticed that ntpd(8) is not running (no open ports, no process, just the drift and pid files). Running in debug mode I noticed:

event at 1 c617 07 panic_stop +3600 s; set clock manually within 1000 s.
event at 1 c61d 0d kern kernel time sync disabled

I am running FreeBSD 10.2:

FreeBSD 10.2-RELEASE FreeBSD 10.2-RELEASE #0 r286666: Wed Aug 12 15:26:37 UTC 2015  amd64

Shouldn't the kernel time sync be enabled by default to allow ntpd(8) to work properly?

Any other ideas about if and why this is happening are welcome.




Reaction score: 602
Messages: 1,543

event at 1 c617 07 panic_stop +3600 s; set clock manually within 1000 s

ntpd will refuse to set the clock if it's too far out, and will just exit. I guess it's to protect against some rogue NTP server giving it bogus time information. If a time server goes wrong and gives you info that is weeks/months/years out, it could cause havok for your server.

Either set the time to something nearly correct manually, or use the ntpdate command to set it once from a time server. I usually use something like the below.
# ntpdate
You can then restart the ntpd service