[ntp:questions] "Oneshot" time sync without risk of jumping time?

William Unruh unruh at invalid.ca
Sun Apr 27 15:28:29 UTC 2014


On 2014-04-27, mike cook <michael.cook at sfr.fr> wrote:
>
> Le 27 avr. 2014 ? 10:49, Manuel Reimer a ?crit :
>
>> Hello,
>> 
>> I want to keep the time updated on a small Embedded Linux device.
>> 
>> The clock doesn't have to be very accurate. An offset of a few seconds is OK.
>> 
>> This small device only has Internet for a few minutes a day and I have to pay for each byte that gets transmitted, so I want to keep the traffic low.
>> 
>> My idea to solve this was to run "ntpd -xq" as soon as I have established my Internet connection.
>> 
>> The problem with this is that the time jumps if the difference is above 600s.
>> 
>> The documentation about the "-g" option says that there is a "panic threshold" which is 1000s "by default". What does "by default" mean? Does this mean that this value is configurable? If so: How?
>
>   use the tinker directive in the ntp conf file.
>
>    ex. tinker panic 600
>
>> 
>> What I want ntpd to do is to exit with error status if the time difference is above the 600s limit. I don't want it to set the time forcefully (jumping time) as this may cause trouble with cronjobs running on the device.
>> 
>
>     then use ntpd -gxq and it should slew up to the new panic value, exiting if a correction is needed which is greater.

No, not -g. That says "don't panic-- once" and once is all he uses it
for. 

You could also run chrony constantly, taking it offline when the network
goes down, and online when it comes up and telling it, via chronyc, to
do a burst everytime it comes up. (ntp packets are very small) 

That way it will try to keep disciplining your clock over the long term,
and getting an estimate, over a few days, of the clock rate error.


>
>> Greetings,
>> 
>> Manuel
>> 
>> _______________________________________________
>> questions mailing list
>> questions at lists.ntp.org
>> http://lists.ntp.org/listinfo/questions



More information about the questions mailing list