supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: "cpt.arsemerica.yahoo.com via supervision" <supervision@list.skarnet.org>
To: "supervision@list.skarnet.org" <supervision@list.skarnet.org>,
	 Laurent Bercot <ska-supervision@skarnet.org>
Subject: Re: [svlogd] / -ttt / why UTC?
Date: Thu, 6 Apr 2023 20:37:50 +0000 (UTC)	[thread overview]
Message-ID: <1521010095.494363.1680813470706@mail.yahoo.com> (raw)
In-Reply-To: <em6d775667-2984-4189-ae5a-33038b86fe75@f9605eea.com>

> Yes. You cannot set your system clock to TAI, unless you want wildly
> incorrect results from time() [...]
>
In my world time() returns the SI seconds since the start of 1970.
Since TAI and UTC were off for fractions of a second
from 1970 to the end of 1972 might be true,
but my applications dont care for that time so much...
So I think my results are correct...
Just some little system clock frequency jitter (10msec) and
the round trip time of my VDSL internet connection (<40msec).
But that has nothing to do with /usr/share/zoneinfo/...


>>As long as the software uses glibc's time functions to break down
>>
>Have you tried it?
>
Sure... See:
% TZ=UTC date -d "2017-01-01 - 1 second"
Sat Dec 31 23:59:60 UTC 2016
% TZ=UTC date -d "2017-01-01 - 1 second" +%s
1483228826
% TZ=Etc/TAI date -d@1483228825
Sun Jan  1 00:00:35 TAI 2017
% TZ=UTC date -d@1483228825
Sat Dec 31 23:59:59 UTC 2016
% TZ=Etc/TAI date -d@1483228826
Sun Jan  1 00:00:36 TAI 2017
% TZ=UTC date -d@1483228826
Sat Dec 31 23:59:60 UTC 2016
% TZ=Etc/TAI date -d@1483228827
Sun Jan  1 00:00:37 TAI 2017
% TZ=UTC date -d@1483228827
Sun Jan  1 00:00:00 UTC 2017

I should also say,
that i do not only use a special timezone info file
( http://www0.wgboome.org/zoneinfo-TAI.tar.xz ),
but also a special NTP client,
that adds those 10 seconds,
which i could not do with that TAI file.

> gmtime() *will not work*, because it assumes a UTC system clock.
>
Yes. And that is what it gets...
I sym-linked that /usr/share/zoneinfo-leaps to /usr/share/zoneinfo

> Programs making their own assumptions, and there are a lot of these,
>
Yes, Everything that uses GLib... Javascript and balsa for example...
I patched balsa for myself (GLib devs refused to fix it properly)...
Somewhen I will find a patch for GLib's borkened interpretation of the zoneinfo files... Somewhen... :)

>>What would be wrong about the "-tttt" (localtime time stamp) option?
> In theory, nothing, except that it's a bad idea to timestamp logs
> with local time (hello, we're in the 21st century, we manage computers
> worldwide, we want logs to be shareable and mergeable across timezones).
>
In my case u wound land at TAI timestamps... :)
That's why i am asking...
I dont like to build packages myself...

> By recommending s6-log, I gave you the solution that requires from you
> the least amount of work and the least amount of waiting.
>
OK... s6-log uses localtime, when started with -T...
But that means another 1MiB on my litte root partition... giggle

I think, i will write socklog&svlogd myself...
Maybe i can even use less than 2MiB of main memory...

Or i continue to use svlogd without options,
but then the kernel log lines have a timestamp relative to boot time...
*face palm*

  reply	other threads:[~2023-04-06 20:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1799590563.259018.1680775861585.ref@mail.yahoo.com>
2023-04-06 10:11 ` cpt.arsemerica.yahoo.com via supervision
2023-04-06 11:02   ` Laurent Bercot
2023-04-06 12:47     ` cpt.arsemerica.yahoo.com via supervision
2023-04-06 18:12       ` Laurent Bercot
2023-04-06 20:37         ` cpt.arsemerica.yahoo.com via supervision [this message]
2023-04-09  6:11           ` Jonathan de Boyne Pollard
2023-04-06 23:21         ` Alexis

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=1521010095.494363.1680813470706@mail.yahoo.com \
    --to=supervision@list.skarnet.org \
    --cc=cpt.arsemerica@yahoo.com \
    --cc=ska-supervision@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).