2

I understand ntpd has a -g option to allow a one time immediate clock set for large skews. Then the daemon runs and continuously adjusts. In the event of the skew becoming too large, the daemon exits with an error.

With this understanding, is it sufficient to run a process manager like pm2 that will run ntpd -g when the daemon stops running?

Elliot
  • 121

2 Answers2

3

If ntpd is exiting regularly, it means that it's having problems keeping your clock in sync. You probably want to be notified if this happens, so getting your process monitor to send an email or alert whenever it restarts ntpd might be a good idea.

However, if you have an extremely poor quality local clock, this might happen a lot, so combining the -g flag (which is the default on some distributions) with tinker panic 0 in your ntp.conf (to keep ntpd from exiting) may be necessary. If you do this, you probably want to monitor frequency & offset through a monitoring system.

Paul Gear
  • 4,686
-1

For large time corrections, I suggest you using ntpdate which, by implementing the simpler SNTP protocol, is much faster and only slightly less accurate than ntp.

I generally use it on boot: after having adjusted any large time difference with ntpdate, the ntpd service can do its work by issuing fine-grained time corrections.

shodanshok
  • 52,255