My application must run on a server with time synchronized. In order to do that I installed ntpd
and I check the return value of ntpstat
. It appears that it takes a very long time to get a zero return value from ntpstat
, especially after reboot. Why does it take ntpd
such a long period to get synchronized and how can I make it happen few seconds after reboot?
To synchronize ntp
immediately after reboot, ntpdate
has to run before ntpd
.
To do this in systemd, you can run
systemctl -a | grep ntp
to see if ntpdate is enabled. To enable it is just run
systemctl enable ntpdate
For Linuxes that use lsb
scripts, you can enable ntpdate
via chkconfig
.
chkconfig ntpdate on