supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: "Joël Riou" <joel.riou@normalesup.org>
Subject: Re: Incorrect leap seconds in runit's log timestamps
Date: Wed, 19 Jan 2005 21:37:47 +0100	[thread overview]
Message-ID: <20050119203747.GA9017@greement.salle-s.org> (raw)
In-Reply-To: <von2c2xaqa.ln2@hippo.asfast.net>

Le mercredi 19 janvier 2005, Lloyd Zusman a écrit :
> I believe that TAI and UTC are 21 seconds apart these days, although a
> while ago, the discrepancy was only 11 seconds.

rant {

No, that is not true. First, a very good link on TAI/UTC questions is 
the following page by David A. Madore :
<URL: http://www.eleves.ens.fr:8080/home/madore/misc/time.html >.

Nowadays, the "difference" between TAI and UTC is *precisely* 32 seconds
(see <URL: http://hpiers.obspm.fr/iers/bul/bulc/bulletinc.dat >).

But, for some obscure reason, the epoch is considered to be 
1970-01-01 00:00:10 TAI on Unix systems whose clock is supposed to
correspond to TAI timestamps (i.e. the time() function will return the
number of seconds since that epoch (*), whereas with a GMT-time, this
function is supposed to return the number of non-leap seconds since the
epoch (**)). 32-10=22, so the difference between the result of time() in
system with TAI/UTC-times seems to be *22*.

(*) It is the case with right/foo (e.g right/Europe/Paris) glibc timezones.

(**) Due to the fact that the difference between TAI & UTC was not an
integer number of seconds in the beginning of the '70, the epoch
considered by TAI and UTC systems do not match exactly [so why the hell
1970-01-01 00:00:10 TAI was chosen as an origin instead of
1970-01-01 00:00:00 TAI ?!]

To be more specific, provided I understand well both runit and skalibs
tai code, the tai functions assume that time()/gettimeofday() return the
number of seconds since 1970-01-01 00:00:10 TAI, which I think is the
Right Thing ; so if your computer uses another convention (UTC ?), you
can get confusing results. [at this point, my brain is too damaged to
check that this precisely explains your particular trouble...]

}

More seriously, the main trouble in this domain is that, as far as I
know, ntpd assumes that the Unix time is ruled by UTC [which is quite
confusing because the NTP protocol has allegedly some stuff to propagate
the table of leap seconds from servers to clients]. I used to think about
some dynamic library to LD_PRELOAD to ntpd to emulate UTC time()
functions on a system with TAI time, but that would be very ugly.

-- 
Joël Riou



  reply	other threads:[~2005-01-19 20:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-19 19:07 Lloyd Zusman
2005-01-19 20:37 ` Joël Riou [this message]
2005-01-19 23:56   ` Lloyd Zusman
2005-01-20  0:34     ` Never mind! (was: Incorrect leap seconds in runit's log timestamps) Lloyd Zusman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050119203747.GA9017@greement.salle-s.org \
    --to=joel.riou@normalesup.org \
    --cc=supervision@list.skarnet.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).