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

mike cook michael.cook at sfr.fr
Sun Apr 27 14:54:27 UTC 2014


Le 27 avr. 2014 à 16:19, mike cook a écrit :

> 
> Le 27 avr. 2014 à 14:59, Manuel Reimer a écrit :
> 
>> On 04/27/2014 11:37 AM, mike cook wrote:
>>>  use the tinker directive in the ntp conf file.
>>> 
>>>   ex. tinker panic 600
>> 
>> Thank you for this information, but where is this documented? At least my "man ntp.conf" doesn't know a "tinker".
> 
>   in 4.2.4p4, not yours or  in 4.2.7p319
> 
> I tried setting it and started ntpd in debug mode and didn't get any error.  Maybe the option has been removed. I'll do a test.
 

mike at raspberrypi ~ $ grep tinker /etc/ntp.conf
# tinker options
  tinker panic 600

Setting the date back lots


mike at raspberrypi ~ $ sudo date -u 03272014
Thu Mar 27 20:14:00 UTC 2014
mike at raspberrypi ~ $ date
Thu Mar 27 21:14:03 CET 2014
mike at raspberrypi ~ $ sudo /usr/bin/ntpd -c /etc/ntp.conf -gxq
27 Mar 21:14:18 ntpd[3436]: ntpd 4.2.7p319 at 1.2483 Tue May 28 11:26:22 UTC 2013 (2): Starting
27 Mar 21:14:18 ntpd[3436]: proto: precision = 2.000 usec (-19)
27 Mar 21:14:18 ntpd[3436]: Listen and drop on 0 v4wildcard 0.0.0.0:123
27 Mar 21:14:18 ntpd[3436]: Listen normally on 1 lo 127.0.0.1:123
27 Mar 21:14:18 ntpd[3436]: Listen normally on 2 eth0 192.168.1.15:123
27 Mar 21:14:18 ntpd[3436]: peers refreshed
27 Mar 21:14:18 ntpd[3436]: Listening on routing socket on fd #19 for interface updates
27 Mar 21:14:18 ntpd[3436]: refclock_atom: /dev/pps0: No such file or directory
27 Mar 21:14:18 ntpd[3436]: 127.127.22.0 local addr 127.0.0.1 -> <null>
27 Apr 16:15:38 ntpd[3436]: ntpd: time set +2656870.060204 s
ntpd: time set +2656870.060204s

So it looks like -g allows the step even with the tinker variable when the difference is really big.

Setting date back  a little

mike at raspberrypi ~ $ sudo date -u 042714252014.20
Sun Apr 27 14:25:20 UTC 2014
mike at raspberrypi ~ $ date
Sun Apr 27 16:25:26 CEST 2014
mike at raspberrypi ~ $ sudo /usr/bin/ntpd -c /etc/ntp.conf -gxq
27 Apr 16:26:04 ntpd[3518]: ntpd 4.2.7p319 at 1.2483 Tue May 28 11:26:22 UTC 2013 (2): Starting
27 Apr 16:26:04 ntpd[3518]: proto: precision = 2.000 usec (-19)
27 Apr 16:26:04 ntpd[3518]: Listen and drop on 0 v4wildcard 0.0.0.0:123
27 Apr 16:26:04 ntpd[3518]: Listen normally on 1 lo 127.0.0.1:123
27 Apr 16:26:04 ntpd[3518]: Listen normally on 2 eth0 192.168.1.15:123
27 Apr 16:26:04 ntpd[3518]: peers refreshed
27 Apr 16:26:04 ntpd[3518]: Listening on routing socket on fd #19 for interface updates
27 Apr 16:26:04 ntpd[3518]: refclock_atom: /dev/pps0: No such file or directory
27 Apr 16:26:04 ntpd[3518]: 127.127.22.0 local addr 127.0.0.1 -> <null>
27 Apr 16:26:14 ntpd[3518]: ntpd: time slew +107.943014 s
ntpd: time slew +107.943014s

   slews fine , this is a normal case

setting date > panicgate time and just using -xq

mike at raspberrypi ~ $ sudo date -u 042714152014.20
Sun Apr 27 14:15:20 UTC 2014
mike at raspberrypi ~ $ sudo /usr/bin/ntpd -c /etc/ntp.conf -xq
27 Apr 16:15:31 ntpd[3533]: ntpd 4.2.7p319 at 1.2483 Tue May 28 11:26:22 UTC 2013 (2): Starting
27 Apr 16:15:31 ntpd[3533]: proto: precision = 2.000 usec (-19)
27 Apr 16:15:31 ntpd[3533]: Listen and drop on 0 v4wildcard 0.0.0.0:123
27 Apr 16:15:31 ntpd[3533]: Listen normally on 1 lo 127.0.0.1:123
27 Apr 16:15:31 ntpd[3533]: Listen normally on 2 eth0 192.168.1.15:123
27 Apr 16:15:31 ntpd[3533]: peers refreshed
27 Apr 16:15:31 ntpd[3533]: Listening on routing socket on fd #19 for interface updates
27 Apr 16:15:31 ntpd[3533]: refclock_atom: /dev/pps0: No such file or directory
27 Apr 16:15:31 ntpd[3533]: 127.127.22.0 local addr 127.0.0.1 -> <null>
mike at raspberrypi ~ $ date
Sun Apr 27 16:15:46 CEST 2014
mike at raspberrypi ~ $ ntpdate -d muon
27 Apr 16:17:18 ntpdate[3540]: ntpdate 4.2.7p319 at 1.2483 Tue May 28 11:26:37 UTC 2013 (2)
....
27 Apr 16:17:25 ntpdate[3540]: step time server 192.168.1.4 offset 992.846341 sec
mike at raspberrypi ~ $ 

So it looks like ntpd made no action with the tinker at its new value but less than the default of 1000s

 Not sure this covers all cases.


> 
>> 
>> $ ntpd --version
>> ntpd 4.2.6p5
>> ntpd 4.2.6p5 at 1.2349-o Tue Mar 11 04:36:06 UTC 2014 (1)
>> 
>> _______________________________________________
>> questions mailing list
>> questions at lists.ntp.org
>> http://lists.ntp.org/listinfo/questions
> _______________________________________________
> questions mailing list
> questions at lists.ntp.org
> http://lists.ntp.org/listinfo/questions


More information about the questions mailing list