[ntp:questions] Leap seconds

David Woolley david at djwhome.demon.co.uk
Mon Jan 24 21:43:30 UTC 2005

In article <mailman.2.1106581055.88045.questions at lists.ntp.isc.org>,
Alain <alainm at pobox.com> wrote:

> It looks like the "safest way on critical systems" and "I don care much 
> but want to be on the safe side" would be not to step and just skew that 
> extra/missing second. Would the "-x" option do that?

This is the opposite of the official advice which is not to override
the step recovery.  In normal operation, if a step is necessary, NTP
is too far out of lock to safely continue and the best thing is to
staigthen things out as quickly as possible and then try and continue

As far as I know, -x is no longer supported, and may never have worked.
The tinker way of doing this has, I believe, side effects, like disabling
the kernel time discipline code (which, see below, may a particularly
bad thing to do with respect to leap seconds).

If you have a system that requires accurate time across a leap second,
you should use a kernel that understands leap seconds and an ntpd 
system dependent module that understands that kernel.  You shouldn't
of course, use time of day differences for accurate durations.

It looks like the kernel time discipline interface passes leap seconds
to the kernel, so hopefully, a kernel with kernel NTP support will
not lose sync, even if it duplicates the midnight second.  The Linux
kernel, at least for 2.4.5, appears to honour these indictions:

Linux Kernel 2.4.5 - note that 23:59:59 is repeated:
    case TIME_INS:
        if (xtime.tv_sec % 86400 == 0) {
            time_state = TIME_OOP;
            printk(KERN_NOTICE "Clock: inserting leap second 23:59:60 UTC\n");

    case TIME_DEL:
        if ((xtime.tv_sec + 1) % 86400 == 0) {
            time_state = TIME_WAIT;
            printk(KERN_NOTICE "Clock: deleting leap second 23:59:59 UTC\n");

ntpd 4.2.0:

                         * Set the leap bits in the status word.
                        if (sys_leap == LEAP_NOTINSYNC) {
                                ntv.status |= STA_UNSYNC;
                        } else if (calleapwhen(sys_reftime.l_ui) <
                                    CLOCK_DAY) {
                                if (sys_leap & LEAP_ADDSECOND)
                                        ntv.status |= STA_INS;
                                else if (sys_leap & LEAP_DELSECOND)
                                        ntv.status |= STA_DEL;

> X-Accept-Language: pt-br, pt

Sorry, unable to comply.  At its best my Portuguese was at the please
and thankyou level.

More information about the questions mailing list