Is there a way to ensure that ntp synchronized clocks never move backward?

Say I have a code that uses a clock to generate identifiers. Or I have code that calculates the time elapsed since the event occurred. Or any other logic that expects system time to only move forward, not backward. If time moves backward, and the program notices this, let's say that it crashes or freezes.

I would like to use the NTP service with such programs. Is there a way that NTP can be configured so that it never sets the time back? Slowing down the system clock will be wonderful.

Thus, the second may be longer or shorter, but the system time should never move backward.

0
ntp
source share
1 answer

With standard ntpd, you can take a look at the tinker configuration command. It allows you to specify “never step on the clock” by setting “stepback 0” and (if you also do not want the clock to move forward) “stepfwd 0” (or even a simple “step 0”).

Otherwise, it will be a step (back) if the local clock is behind> = 128 ms and stop working if the local clock is off> = 1000 s

+1
source share

All Articles