Re: [ntp:questions] Trouble Simulating Leap Seconds

2015-04-15 Thread Chris Walton
> Should that be date -u -s?
No; the "-s" flag is not required here.
This command works just fine:
  date -u 063023452015.00
It is equivalent to this:
  date -u -s "jun 30 2015 23:45:00"

> You also need the flagged lines in leapseconds, as the SHA1 hash includes 
> those
> digit strings:
> #$   3629404800
> #@  3660249600
I am not going to argue about whether those lines should or should not exist in 
the leap seconds file.
All I can say is that everything worked perfectly for me without them.

-chris
___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions


Re: [ntp:questions] Trouble Simulating Leap Seconds

2015-04-15 Thread Brian Inglis

On 2015-04-15 09:07, Chris Walton wrote:

These are the exact commands that are working perfectly for me on a recently 
updated RHEL_6.6 system:
   service ntpd stop
   sleep  5
   ntptime -s 0
   date -u 063023452015.00


Should that be date -u -s?


/etc/leapseconds looks like this:
   2272060800  10  # 1 Jan 1972

...

   3644697600  36  # 1 Jul 2015


You also need the flagged lines in leapseconds, as the SHA1 hash includes those 
digit strings:
#$   3629404800
#@  3660249600
...
#h  45e70fa7 a9df2033 f4a49ab0 ec648273 7b6c22c

It would be nice if NIST updated the hash to something secure, like SHA-512, 
and authenticated the file with a public key.

--
Take care. Thanks, Brian Inglis
___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions


Re: [ntp:questions] Trouble Simulating Leap Seconds

2015-04-15 Thread Chris Walton
These are the exact commands that are working perfectly for me on a recently 
updated RHEL_6.6 system:
  service ntpd stop
  sleep  5
  ntptime -s 0
  date -u 063023452015.00
  service ntpd start

ntp.conf looks like this
  server 127.127.1.1
  fudge  127.127.1.1 stratum 1
  leapfile /etc/leapseconds
  driftfile /var/lib/ntp/drift

/etc/leapseconds looks like this:
  2272060800  10  # 1 Jan 1972
  2287785600  11  # 1 Jul 1972
  2303683200  12  # 1 Jan 1973
  2335219200  13  # 1 Jan 1974
  2366755200  14  # 1 Jan 1975
  2398291200  15  # 1 Jan 1976
  2429913600  16  # 1 Jan 1977
  2461449600  17  # 1 Jan 1978
  2492985600  18  # 1 Jan 1979
  2524521600  19  # 1 Jan 1980
  2571782400  20  # 1 Jul 1981
  2603318400  21  # 1 Jul 1982
  2634854400  22  # 1 Jul 1983
  2698012800  23  # 1 Jul 1985
  2776982400  24  # 1 Jan 1988
  2840140800  25  # 1 Jan 1990
  2871676800  26  # 1 Jan 1991
  2918937600  27  # 1 Jul 1992
  2950473600  28  # 1 Jul 1993
  2982009600  29  # 1 Jul 1994
  3029443200  30  # 1 Jan 1996
  3076704000  31  # 1 Jul 1997
  3124137600  32  # 1 Jan 1999
  3345062400  33  # 1 Jan 2006
  3439756800  34  # 1 Jan 2009
  3550089600  35  # 1 Jul 2012
  3644697600  36  # 1 Jul 2015

ntpd and its arguments looks like this:
  ntpd -u ntp:ntp -p /var/run/ntpd.pid -g (note the lack of a "-x" flag)

Here is the output of "ntptime" when run with no arguments at 23:55:
ntptime
  ntp_gettime() returns code 1 (INS)
time d93dab0d.0028b2a8  Tue, Jun 30 2015 23:55:57.000, (.000621170),
   maximum error 18428 us, estimated error 1 us, TAI offset 35
  ntp_adjtime() returns code 1 (INS)
modes 0x0 (),
offset 0.000 us, frequency 13.802 ppm, interval 1 s,
maximum error 18428 us, estimated error 1 us,
status 0x2011 (PLL,INS,NANO),
time constant 6, precision 0.001 us, tolerance 500 ppm,

And finally, this is the output of a perl script that spits out the time every 
500ms:
  Jun 30 2015 23:59:57.398
  Jun 30 2015 23:59:57.898
  Jun 30 2015 23:59:58.398
  Jun 30 2015 23:59:58.898
  Jun 30 2015 23:59:59.398
  Jun 30 2015 23:59:59.898
  Jun 30 2015 23:59:59.399
  Jun 30 2015 23:59:59.899
  Jul 01 2015 00:00:00.399
  Jul 01 2015 00:00:00.899
  Jul 01 2015 00:00:01.399
  Jul 01 2015 00:00:01.899
  Jul 01 2015 00:00:02.399
  Jul 01 2015 00:00:02.899

-chris
___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions


Re: [ntp:questions] Trouble Simulating Leap Seconds

2015-04-14 Thread Miroslav Lichvar
On Wed, Apr 08, 2015 at 12:31:18PM -0400, Jim Witschey wrote:
> Thanks for the pointer, Chris -- that didn't seem to help, though. I'd
> been setting the clock to 23:50, and INS wasn't set at midnight when I
> changing that to 23:45.

With what ntp version are you trying this and does is it have a valid
drift file on start? If it's a 4.2.6 or older and there is no drift
file, it will need at least 15 minutes to estimate the initial
frequency and only then it can set the leap status.

Also, is the server reporting synchronized status right from the
start? You might want to start at 23:30 to be sure both server and
client had enough time to synchronize. 

-- 
Miroslav Lichvar
___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions


Re: [ntp:questions] Trouble Simulating Leap Seconds

2015-04-08 Thread Jim Witschey
Thanks for the pointer, Chris -- that didn't seem to help, though. I'd
been setting the clock to 23:50, and INS wasn't set at midnight when I
changing that to 23:45.

Jim Witschey

Software Engineer in Test | jim.witsc...@datastax.com


On Tue, Apr 7, 2015 at 1:08 PM, Chris Walton  wrote:
> Jim,
>
> Are you giving ntpd long enough to stabilize?
> The INS flag won't typically get set until several minutes after ntpd reports 
> synchronization.
>
> Try setting your clock to 23:45UTC at the beginning of your test.
>
> -chris
>
> ___
> questions mailing list
> questions@lists.ntp.org
> http://lists.ntp.org/listinfo/questions
___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions


[ntp:questions] Trouble Simulating Leap Seconds

2015-04-07 Thread Chris Walton
Jim,

Are you giving ntpd long enough to stabilize?
The INS flag won't typically get set until several minutes after ntpd reports 
synchronization.

Try setting your clock to 23:45UTC at the beginning of your test.

-chris

___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions


Re: [ntp:questions] Trouble Simulating Leap Seconds

2015-04-07 Thread Jim Witschey
I've found a workaround that I believe will be good enough. I let
`ntpd` deal with keeping clocks synced, and I'm using the `adjtimex`
command-line tool to set the INS flag.

If anyone has any insight on how to avoid having to do this, or any
warnings about why this might not be a reliable simulation of leap
second insertion, please let me know. Thanks,

Jim
___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions


Re: [ntp:questions] Trouble Simulating Leap Seconds

2015-04-07 Thread Miroslav Lichvar
On Mon, Apr 06, 2015 at 01:56:48PM -0400, Jim Witschey wrote:
> Do I understand correctly that add_leap_second is an NTP-internal
> flag, while INS is a kernel flag? If so: when does the INS flag get
> set in the kernel? Should I expect ntpd to do so?

ntpd should set the kernel flag by calling ntp_adjtime()/adjtimex()
with STA_INS in the status field. You could run ntpd in strace to
verify that.

-- 
Miroslav Lichvar
___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions


Re: [ntp:questions] Trouble Simulating Leap Seconds

2015-04-06 Thread Jim Witschey
Do I understand correctly that add_leap_second is an NTP-internal
flag, while INS is a kernel flag? If so: when does the INS flag get
set in the kernel? Should I expect ntpd to do so?

Thanks.

On Fri, Apr 3, 2015 at 11:50 AM, Jim Witschey  wrote:
>> Does status printed by ntptime include INS before midnight? Any chance
>> ntpd is started with the -x option or there is "tinker step" command
>> in ntp.conf?
>
> No `tinker` commands in `ntp.conf`. `ps axf` indicates that ntpd
> wasn't started with any options other than -p, -u, and -g.
>
> However, `ntptime` doesn't show anything about INS. Here's the output
> from the server:
>
> ntp_gettime() returns code 0 (OK)
> time d93dab7a.1db877a0  Tue, Jun 30 2015 23:57:46.116, (.116096333),
> maximum error 8176001 us, estimated error 0 us, TAI offset 36
> ntp_adjtime() returns code 0 (OK)
> modes 0x0 (),
> offset 0.000 us, frequency 0.000 ppm, interval 1 s,
> maximum error 8176001 us, estimated error 0 us,
> status 0x2001 (PLL,NANO),
> time constant 6, precision 0.001 us, tolerance 500 ppm,
>
> And from one of the clients:
>
> ntp_gettime() returns code 0 (OK)
> time d93dab7a.227ef9d0  Tue, Jun 30 2015 23:57:46.134, (.134750490),
> maximum error 1083949 us, estimated error 3910 us, TAI offset 0
> ntp_adjtime() returns code 0 (OK)
> modes 0x0 (),
> offset -4478.656 us, frequency -2.141 ppm, interval 1 s,
> maximum error 1083949 us, estimated error 3910 us,
> status 0x2001 (PLL,NANO),
> time constant 6, precision 0.001 us, tolerance 500 ppm,
___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions


Re: [ntp:questions] Trouble Simulating Leap Seconds

2015-04-03 Thread Jim Witschey
> Does status printed by ntptime include INS before midnight? Any chance
> ntpd is started with the -x option or there is "tinker step" command
> in ntp.conf?

No `tinker` commands in `ntp.conf`. `ps axf` indicates that ntpd
wasn't started with any options other than -p, -u, and -g.

However, `ntptime` doesn't show anything about INS. Here's the output
from the server:

ntp_gettime() returns code 0 (OK)
time d93dab7a.1db877a0  Tue, Jun 30 2015 23:57:46.116, (.116096333),
maximum error 8176001 us, estimated error 0 us, TAI offset 36
ntp_adjtime() returns code 0 (OK)
modes 0x0 (),
offset 0.000 us, frequency 0.000 ppm, interval 1 s,
maximum error 8176001 us, estimated error 0 us,
status 0x2001 (PLL,NANO),
time constant 6, precision 0.001 us, tolerance 500 ppm,

And from one of the clients:

ntp_gettime() returns code 0 (OK)
time d93dab7a.227ef9d0  Tue, Jun 30 2015 23:57:46.134, (.134750490),
maximum error 1083949 us, estimated error 3910 us, TAI offset 0
ntp_adjtime() returns code 0 (OK)
modes 0x0 (),
offset -4478.656 us, frequency -2.141 ppm, interval 1 s,
maximum error 1083949 us, estimated error 3910 us,
status 0x2001 (PLL,NANO),
time constant 6, precision 0.001 us, tolerance 500 ppm,
___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions


Re: [ntp:questions] Trouble Simulating Leap Seconds

2015-04-02 Thread Miroslav Lichvar
On Wed, Apr 01, 2015 at 04:20:57PM -0400, Jim Witschey wrote:
> The server's warning for the upcoming leap second seems to propogate
> to the clients, as I see `leap_armed` in the output for `ntpq -c rl`
> before midnight, and `leap_event` afterwards. However, when I loop
> `date -u` over the leap second, I don't see a leap second getting
> inserted -- I expect 23:59:59 to last for 2 seconds, but it doesn't.
> The time goes straight from 23:59:59 to 00:00:00 the next day.
> 
> In addition, I don't see any information about inserted leap seconds
> in the logs when I search with `dmesg | grep leap` or `sudo grep leap
> /var/log/syslog`.

Does status printed by ntptime include INS before midnight? Any chance
ntpd is started with the -x option or there is "tinker step" command
in ntp.conf?

-- 
Miroslav Lichvar
___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions


Re: [ntp:questions] Trouble Simulating Leap Seconds

2015-04-02 Thread Jim Witschey
I used

while true ; do echo "`date +%s%N` `date -u`" ; sleep .5 ; done

Output around midnight looked like:

1435708798151332202 Tue Jun 30 23:59:58 UTC 2015
1435708798660770847 Tue Jun 30 23:59:58 UTC 2015
1435708799170680057 Tue Jun 30 23:59:59 UTC 2015
1435708799680093377 Tue Jun 30 23:59:59 UTC 2015
1435708800189430358 Wed Jul  1 00:00:00 UTC 2015
1435708800698723411 Wed Jul  1 00:00:00 UTC 2015
1435708801208174011 Wed Jul  1 00:00:01 UTC 2015
1435708801717843414 Wed Jul  1 00:00:01 UTC 2015
1435708802227355779 Wed Jul  1 00:00:02 UTC 2015
1435708802737252335 Wed Jul  1 00:00:02 UTC 2015

As much as I wish it were, I don't think it's a measurement problem --
even half-second resolution should have caught it. Thanks for the tip,
though, Brian!
Jim Witschey

Software Engineer in Test | 434-270-8586 | jim.witsc...@datastax.com





On Thu, Apr 2, 2015 at 4:57 PM, Brian Inglis
 wrote:
> To get higher resolution try something like:
> while sleep 0.1 ; do date -u -Ins ; done
>
> --
> Take care. Thanks, Brian Inglis
>
>
> On 2015-04-02 08:08, Jim Witschey wrote:
>>
>> UTC -- I'm using `date -u`.
>
>
>> On Thu, Apr 2, 2015 at 2:44 AM, Marco Marongiu 
>> wrote:
>>>
>>> 23:59:59 of which timezone?
>>>
>>> Il 02/apr/2015 03:14 "Jim Witschey"  ha
>>> scritto:
>
>
 I'm trying to simulate a leap second on a cluster of Ubuntu AWS
 instances via NTP, and I could use some help. I've set up a basic NTP
 server with a leapfile as described here:

 https://support.ntp.org/bin/view/Dev/LeapSecondTest

 The server's warning for the upcoming leap second seems to propogate
 to the clients, as I see `leap_armed` in the output for `ntpq -c rl`
 before midnight, and `leap_event` afterwards. However, when I loop
 `date -u` over the leap second, I don't see a leap second getting
 inserted -- I expect 23:59:59 to last for 2 seconds, but it doesn't.
 The time goes straight from 23:59:59 to 00:00:00 the next day.

 In addition, I don't see any information about inserted leap seconds
 in the logs when I search with `dmesg | grep leap` or `sudo grep leap
 /var/log/syslog`.

 Am I missing something? I can provide more information on request.
>
>
> ___
> questions mailing list
> questions@lists.ntp.org
> http://lists.ntp.org/listinfo/questions
___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions


Re: [ntp:questions] Trouble Simulating Leap Seconds

2015-04-02 Thread Brian Inglis

To get higher resolution try something like:
while sleep 0.1 ; do date -u -Ins ; done

--
Take care. Thanks, Brian Inglis


On 2015-04-02 08:08, Jim Witschey wrote:

UTC -- I'm using `date -u`.



On Thu, Apr 2, 2015 at 2:44 AM, Marco Marongiu  wrote:

23:59:59 of which timezone?

Il 02/apr/2015 03:14 "Jim Witschey"  ha scritto:



I'm trying to simulate a leap second on a cluster of Ubuntu AWS
instances via NTP, and I could use some help. I've set up a basic NTP
server with a leapfile as described here:

https://support.ntp.org/bin/view/Dev/LeapSecondTest

The server's warning for the upcoming leap second seems to propogate
to the clients, as I see `leap_armed` in the output for `ntpq -c rl`
before midnight, and `leap_event` afterwards. However, when I loop
`date -u` over the leap second, I don't see a leap second getting
inserted -- I expect 23:59:59 to last for 2 seconds, but it doesn't.
The time goes straight from 23:59:59 to 00:00:00 the next day.

In addition, I don't see any information about inserted leap seconds
in the logs when I search with `dmesg | grep leap` or `sudo grep leap
/var/log/syslog`.

Am I missing something? I can provide more information on request.


___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions


Re: [ntp:questions] Trouble Simulating Leap Seconds

2015-04-02 Thread Jim Witschey
UTC -- I'm using `date -u`.
Jim Witschey

Software Engineer in Test | 434-270-8586 | jim.witsc...@datastax.com





On Thu, Apr 2, 2015 at 2:44 AM, Marco Marongiu  wrote:
> 23:59:59 of which timezone?
>
> Il 02/apr/2015 03:14 "Jim Witschey"  ha scritto:
>>
>> Hey all,
>>
>> I'm trying to simulate a leap second on a cluster of Ubuntu AWS
>> instances via NTP, and I could use some help. I've set up a basic NTP
>> server with a leapfile as described here:
>>
>> https://support.ntp.org/bin/view/Dev/LeapSecondTest
>>
>> The server's warning for the upcoming leap second seems to propogate
>> to the clients, as I see `leap_armed` in the output for `ntpq -c rl`
>> before midnight, and `leap_event` afterwards. However, when I loop
>> `date -u` over the leap second, I don't see a leap second getting
>> inserted -- I expect 23:59:59 to last for 2 seconds, but it doesn't.
>> The time goes straight from 23:59:59 to 00:00:00 the next day.
>>
>> In addition, I don't see any information about inserted leap seconds
>> in the logs when I search with `dmesg | grep leap` or `sudo grep leap
>> /var/log/syslog`.
>>
>> Am I missing something? I can provide more information on request.
>>
>> Jim Witschey
>> ___
>> questions mailing list
>> questions@lists.ntp.org
>> http://lists.ntp.org/listinfo/questions
___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions


Re: [ntp:questions] Trouble Simulating Leap Seconds

2015-04-01 Thread Marco Marongiu
23:59:59 of which timezone?
 Il 02/apr/2015 03:14 "Jim Witschey"  ha scritto:

> Hey all,
>
> I'm trying to simulate a leap second on a cluster of Ubuntu AWS
> instances via NTP, and I could use some help. I've set up a basic NTP
> server with a leapfile as described here:
>
> https://support.ntp.org/bin/view/Dev/LeapSecondTest
>
> The server's warning for the upcoming leap second seems to propogate
> to the clients, as I see `leap_armed` in the output for `ntpq -c rl`
> before midnight, and `leap_event` afterwards. However, when I loop
> `date -u` over the leap second, I don't see a leap second getting
> inserted -- I expect 23:59:59 to last for 2 seconds, but it doesn't.
> The time goes straight from 23:59:59 to 00:00:00 the next day.
>
> In addition, I don't see any information about inserted leap seconds
> in the logs when I search with `dmesg | grep leap` or `sudo grep leap
> /var/log/syslog`.
>
> Am I missing something? I can provide more information on request.
>
> Jim Witschey
> ___
> questions mailing list
> questions@lists.ntp.org
> http://lists.ntp.org/listinfo/questions
>
___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions


[ntp:questions] Trouble Simulating Leap Seconds

2015-04-01 Thread Jim Witschey
Hey all,

I'm trying to simulate a leap second on a cluster of Ubuntu AWS
instances via NTP, and I could use some help. I've set up a basic NTP
server with a leapfile as described here:

https://support.ntp.org/bin/view/Dev/LeapSecondTest

The server's warning for the upcoming leap second seems to propogate
to the clients, as I see `leap_armed` in the output for `ntpq -c rl`
before midnight, and `leap_event` afterwards. However, when I loop
`date -u` over the leap second, I don't see a leap second getting
inserted -- I expect 23:59:59 to last for 2 seconds, but it doesn't.
The time goes straight from 23:59:59 to 00:00:00 the next day.

In addition, I don't see any information about inserted leap seconds
in the logs when I search with `dmesg | grep leap` or `sudo grep leap
/var/log/syslog`.

Am I missing something? I can provide more information on request.

Jim Witschey
___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions