supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: Lloyd Zusman <ljz@asfast.com>
Cc: "Joël Riou" <joel.riou@normalesup.org>
Subject: Re: Incorrect leap seconds in runit's log timestamps
Date: Wed, 19 Jan 2005 18:56:47 -0500	[thread overview]
Message-ID: <m3oeflx9a8.fsf@asfast.com> (raw)
In-Reply-To: <20050119203747.GA9017@greement.salle-s.org>

Joël Riou <joel.riou@normalesup.org> writes:

> [ ... ]
>
> 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*.

Ah ... OK.  So now I know where the delta of 10 seconds comes from.

[sensation of fog lifting]

Thanks.


> [ ... ]
>
> 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...]

Well, I'm using 'clockspeed' to keep my system clock on TAI, and that
clock is indeed in sync with this resource (at least that's what the
clockspeed utilities seem to say).  However, the 'runit' timestamps are
10 seconds later than what 'clockspeed' tells me.  Perhaps 'clockspeed'
uses 1970-01-01@00:00:00Z as it's base instead of the correct
1970-01-01@00:00:10Z TAI starting point?

Before I go over to the 'tai' mailing list, I want to make sure that I
understand why 'runit' and 'clockspeed' seem to be using different
starting times, so I can try to sound at least halfway knowledgeable
about this when I pose my question on that list.

Any thoughts as to why 'runit' and 'clockspeed' are out of sync?


> 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.

Well, I left the ntpd world and I'm sticking with 'clockspeed'.  But
given this 10-second discrepancy, it too seems to have its problems
... or at least some confusing complications.



-- 
 Lloyd Zusman
 ljz@asfast.com
 God bless you.



  reply	other threads:[~2005-01-19 23:56 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
2005-01-19 23:56   ` Lloyd Zusman [this message]
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=m3oeflx9a8.fsf@asfast.com \
    --to=ljz@asfast.com \
    --cc=joel.riou@normalesup.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).