Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to insert a leap second with ntpq

850 views
Skip to first unread message

ZHOU.Jun

unread,
Jun 20, 2012, 12:30:37 AM6/20/12
to
Hello,

I have a question about leap indicator.

I need to do some tests with ntpd and I want to have NTP packets set Leap indicator in order to insert a leap second to a Linux server running ntp client.

How can I configure the server to generate a packet with Leap indicator 0x01?

Thanks in advance.
I got the syntax of ntpq is as follows
Syntax

ntpq [ -i ] [ -n ] [ -p ] [ -c SubCommand ] [ Host ... ]

Leap Indicator (LI)

Code warning of impending leap-second to be inserted at the end of
the last day of the current month. Bits are coded as follows:

00 no warning
01 +1 second (following minute has 61 seconds)
10 -1 second (following minute has 59 seconds)
11 reserved for future use

Dave Hart

unread,
Jun 20, 2012, 1:42:04 AM6/20/12
to
On Wed, Jun 20, 2012 at 4:30 AM, ZHOU.Jun wrote:
> I need to do some tests with ntpd and I want to have NTP packets set Leap
> indicator in order to insert a leap second to a Linux server running ntp client.
>
> How can I configure the server to generate a packet with Leap indicator 0x01?

Install the "leapfile" informing ntpd of the leap second to be
inserted at the end of this month:

http://support.ntp.org/bin/view/Support/ConfiguringNTP#Section_6.14.

Set the clock to the last day of this month -- verify with "date -u"
which will show the UTC time. The insertion happens at the start of
July 1 UTC.

Cheers,
Dave Hart

ZHOU.Jun

unread,
Jun 20, 2012, 9:00:31 AM6/20/12
to
在 2012年6月20日星期三UTC+8下午1时42分04秒,Dave Hart写道:
Hi Hart
Thanks for your information.
I will follow your method.

ZHOU.Jun

unread,
Jun 21, 2012, 12:01:10 AM6/21/12
to
在 2012年6月20日星期三UTC+8下午9时00分31秒,ZHOU.Jun写道:
Hello Hart,
I found that my ntp version is 3-5.93e which is before 4.2.6
So I should use the method 6.14.2. NTP Versions before 4.2.6 right?
If I am right, then from the description, I think I need to copy this leap second file to crypto directory. So could you tell me where is the crypto directory?
Thanks in advance.
The leap second file must be copied to the crypto directory configured for ntpd, and inside that directory a link must be created which points to that file. The standard name for the link is ntpkey_leap. However, this can be overridden by a configuration parameter.

David Woolley

unread,
Jun 21, 2012, 2:35:19 AM6/21/12
to
ZHOU.Jun wrote:

> I found that my ntp version is 3-5.93e which is before 4.2.6

That version is extremely obsolete (probably more than a decade,
possibly as much as 15 years). It doesn't support leap second files.
Very few people will be able to remember far enough back to answer your
question, although I suspect the only way of setting the bits is by a
leap second aware clock driver.

Harlan Stenn

unread,
Jun 21, 2012, 2:32:31 AM6/21/12
to
Zhou Xiansheng,

> I found that my ntp version is 3-5.93e which is before 4.2.6
> So I should use the method 6.14.2. NTP Versions before 4.2.6 right?

3-5.93e is *very* old for software:

http://support.ntp.org/bin/view/Dev/ReleaseTimeline

It is NTP3 code, not NTP4. Probably from the spring or summer of 1997.

Is it difficult to upgrade to newer software?

H

ZHOU.Jun

unread,
Jun 21, 2012, 5:16:55 AM6/21/12
to
在 2012年6月21日星期四UTC+8下午2时32分31秒,Harlan Stenn写道:
Yes, because this version is used by our costumers.
I have to be in line with them.
Another question,in my case, I have two NTP server. NTP1 and NTP2
NTP1 is the server and NTP2 is the client.
Normally, I will trigger leap second from NTP1, then theoretically, NTP2 will receive leap second.
Then how can i confirm that NTP2 received the leap second from NTP1?
Thank in advance.

Rob

unread,
Jun 21, 2012, 5:31:06 AM6/21/12
to
ZHOU.Jun <dimoti...@gmail.com> wrote:
> 在 2012年6月21日星期四UTC+8下午2时32分31秒,Harlan Stenn写道:
>> Zhou Xiansheng,
>>
>> > I found that my ntp version is 3-5.93e which is before 4.2.6
>> > So I should use the method 6.14.2. NTP Versions before 4.2.6 right?
>>
>> 3-5.93e is *very* old for software:
>>
>> http://support.ntp.org/bin/view/Dev/ReleaseTimeline
>>
>> It is NTP3 code, not NTP4. Probably from the spring or summer of 1997.
>>
>> Is it difficult to upgrade to newer software?
>>
>> H
>
> Yes, because this version is used by our costumers.
> I have to be in line with them.

Why do you worry about small issues like a leapsecond when you tolerate
your customers to use software as old as that? First things first!

You know what? At the leapsecond time, everything will shake a bit
but within an hour or so everyone again agrees what the correct time
is and all servers are synced again.

We know that from previous experience.

David J Taylor

unread,
Jun 21, 2012, 10:51:38 AM6/21/12
to
With all this discussion of leap-seconds, perhaps it's timely to mention my
simple tools for leap-second checking across servers. You will find NTP
Leap trace here:

http://www.satsignal.eu/software/net.htm#NTPLeapTrace

At this instant, fewer than 1 in 10 of the remote servers I'm using are
indicating a pending leap second, and we are 9 days away from the event. I
can't recall now how long before the event it should be announced by typical
NTP servers.

Cheers,
David

David Lord

unread,
Jun 21, 2012, 11:53:11 AM6/21/12
to
My understanding was that leap seconds only need to be setup
on stratum-1 servers and leap seconds trickle through from those.
On my system with two refclocks non of the other servers showed a
pending leap indication until I copied leapfiles over to them in
anticipation of distributing the refclock signals to them (which
I've not had time to complete). The internet servers I use are
currently all showing as stratum2.

David L

David Woolley

unread,
Jun 21, 2012, 3:57:27 PM6/21/12
to
ZHOU.Jun wrote:

> Yes, because this version is used by our costumers.

Current NTP servers will respond correctly to NTP V3 requests, and can
be forced to act as V3 clients.

> I have to be in line with them.
> Another question,in my case, I have two NTP server. NTP1 and NTP2
> NTP1 is the server and NTP2 is the client.
> Normally, I will trigger leap second from NTP1, then theoretically, NTP2 will receive leap second.
> Then how can i confirm that NTP2 received the leap second from NTP1?

The "rv 0" sub-command of ntpq.

ZHOU.Jun

unread,
Jun 22, 2012, 9:28:54 PM6/22/12
to
在 2012年6月22日星期五UTC+8上午3时57分27秒,David Woolley写道:
> ZHOU.Jun wrote:


Thanks all for your feedback.
Why do you worry about small issues like a leapsecond when you tolerate
your customers to use software as old as that? First things first!
[ZHOU Jun]Since this old version was provided by us,we have to take the responsibility.

You know what? At the leapsecond time, everything will shake a bit
but within an hour or so everyone again agrees what the correct time
is and all servers are synced again.
[ZHOU Jun]I think I know, we have a bug in our software, we facing the risk that kernel will be hanged when deal the leap second issue.

seems rl sub-command is also work.

unruh

unread,
Jun 23, 2012, 2:33:57 AM6/23/12
to
You "quoting" is horrible. VEry hard to know what the old material and
what your answer.


On 2012-06-23, ZHOU.Jun <dimoti...@gmail.com> wrote:
> ??? 2012???6???22????????????UTC+8??????3???57???27??????David Woolley?????????
>> ZHOU.Jun wrote:
>
>
> Thanks all for your feedback.
> Why do you worry about small issues like a leapsecond when you tolerate
> your customers to use software as old as that? First things first!
> [ZHOU Jun]Since this old version was provided by us,we have to take the responsibility.

So why are you supplying such horribly old software?


>
> You know what? At the leapsecond time, everything will shake a bit
> but within an hour or so everyone again agrees what the correct time
> is and all servers are synced again.
> [ZHOU Jun]I think I know, we have a bug in our software, we facing the risk that kernel will be hanged when deal the leap second issue.

How will the kernel hang? the system clock will keep ticking. ntpd will
suddenly discover on its next poll that the local clock is out by a
second. It will wait a while for a few polling intervals to make sure
that this is not due to some temporary abberation, and then step the
local clock (since it is out by more than 128ms. ) You could turn off
stepping.

David J Taylor

unread,
Jun 27, 2012, 12:27:32 PM6/27/12
to
Hi again David,

I ran your Leap Trace program against my gps-based time servers and not one
is showing a leap second pending. Not even this one that is leap-second
configured.

GPSCON is showing a leap second pending on my HP Z3801.

This is very mysterious.

R
======================================

Ron,

I believe the requirement is for the indicator only to be active (i.e.
announced) 24 hours before the event. Doubtless someone will confirm or
deny that.

Cheers,
David
--
SatSignal Software - Quality software written to your requirements
Web: http://www.satsignal.eu
Email: david-...@blueyonder.co.uk

Hahn, Ron

unread,
Jun 27, 2012, 11:55:22 AM6/27/12
to
Hi again David,

I ran your Leap Trace program against my gps-based time servers and not one is showing a leap second pending. Not even this one that is leap-second configured.

GPSCON is showing a leap second pending on my HP Z3801.

This is very mysterious.

R

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

David Lord

unread,
Jun 27, 2012, 6:38:46 PM6/27/12
to
David J Taylor wrote:
> Hi again David,
>
> I ran your Leap Trace program against my gps-based time servers and not
> one is showing a leap second pending. Not even this one that is
> leap-second configured.
>
> GPSCON is showing a leap second pending on my HP Z3801.
>
> This is very mysterious.
>
> R
> ======================================
>
> Ron,
>
> I believe the requirement is for the indicator only to be active (i.e.
> announced) 24 hours before the event. Doubtless someone will confirm or
> deny that.
>


$ ntpq -c rv

gives

leap_armed,
....
tai=34, leapsec=201207010000

Since the leap seconds files were added months ago.


David L



E-Mail Sent to this address will be added to the BlackLists

unread,
Jun 27, 2012, 9:08:31 PM6/27/12
to
On a few clients,
mattnordhoff cheezum st=2, leap=00, leap_none, leapsec=200901010000, expire=201206280000, stale_leapsecond_values
dec clepsydra st=1, leap=00 leap_none, leapsec=201207010000, expire=201212280000, leap_armed
it2go us s01 st=2, leap=01, leap_add_sec
worldspice ns02 st=2, leap=01, leap_add_sec
All Other Assoc st=1-3, leap=00, leap_none

--
E-Mail Sent to this address <Blac...@Anitech-Systems.com>
will be added to the BlackLists.


Michael Tatarinov

unread,
Jun 28, 2012, 1:34:14 AM6/28/12
to
Interesting program but not necessary. ntpq need only.

ntpd 4.2.7
ntpq> mrv &1 &99 srcadr,leap,refid
srcadr=192.168.138.2, leap=00, refid=89.239.186.21
srcadr=192.168.138.24, leap=00, refid=192.168.138.2
srcadr=192.168.138.6, leap=00, refid=192.168.113.2
srcadr=192.168.113.6, leap=00, refid=192.168.113.2
srcadr=0.0.0.0, leap=11, refid=POOL
srcadr=93.180.7.2, leap=00, refid=130.173.91.58
srcadr=62.76.96.10, leap=00, refid=130.173.91.58
srcadr=85.21.78.91, leap=01, refid=193.10.7.246
srcadr=81.95.131.130, leap=00, refid=62.117.76.142
srcadr=195.189.122.154, leap=00, refid=1.1.1.1

or for old ntpd
ntpq> mrv 59605 59614 srcadr,leap,refid
srcadr=192.168.138.2, leap=00, refid=89.239.186.21
srcadr=192.168.138.24, leap=00, refid=192.168.138.2
srcadr=192.168.138.6, leap=00, refid=192.168.113.2
srcadr=192.168.113.6, leap=00, refid=192.168.113.2
srcadr=0.0.0.0, leap=11, refid=POOL
srcadr=93.180.7.2, leap=00, refid=130.173.91.58
srcadr=62.76.96.10, leap=00, refid=130.173.91.58
srcadr=85.21.78.91, leap=01, refid=193.10.7.246
srcadr=81.95.131.130, leap=00, refid=62.117.76.142
srcadr=195.189.122.154, leap=00, refid=1.1.1.1

2012/6/21 David J Taylor <david-...@blueyonder.co.uk.invalid>

David J Taylor

unread,
Jun 28, 2012, 2:59:58 AM6/28/12
to
"Michael Tatarinov" wrote in message
news:CABrG=ZyThJQchY_q90vNk=mNfwZsjeU0Eocj...@mail.gmail.com...

Interesting program but not necessary. ntpq need only.

ntpd 4.2.7
ntpq> mrv &1 &99 srcadr,leap,refid

or for old ntpd
ntpq> mrv 59605 59614 srcadr,leap,refid
=========================================================


Of course, my program is only needed for those of us who lack the ability to
remember those arcane and obscure commands off the top of our heads!
Double-clicking NTPLeapTrace is easier.... <G>

E-Mail Sent to this address will be added to the BlackLists

unread,
Jun 28, 2012, 5:46:43 PM6/28/12
to
Michael Tatarinov wrote:
> ntpd 4.2.7
> mrv &1 &99 srcadr,leap,refid
----------^^^
That doesn't work for at least some (most ?)
flavors before 4.2.7p279 ?
as well as some 4.2.5?, maybe others?
See Also: <http://bugs.ntp.org/show_bug.cgi?id=2220>
0 new messages