Re: [PATCH] rtc: Don't state that the RTC holds UTC in case it doesn't

From: Trent Piepho
Date: Tue Jun 25 2019 - 13:16:59 EST


On Tue, 2019-06-25 at 11:29 +0200, Alexandre Belloni wrote:
>
>
> Userspace is certainly adjusting the timezone after the kernel did. Can
> you run the same commands without running your init?
>
> On stable, you have /etc/init.d/hwclock.sh that still runs and does the
> correct thing. My understanding is that systemd also handles the TZ
> properly after hctosys (see clock_is_localtime()).
>
> Seriously, hctosys does a really bad job at setting the system time, it
> is guaranteed to be always wrong on most platforms. My plan is still to
> try to get distros to stop enabling it and do that properly in
> userspace. This is already ok when using sysV but systemd would need a
> few changes to stop relying on it when then is no hwclock initscript.
> Unfortunately, I didn't have time to work on that yet.

hctosys is very handy in that it sets the system time before any log
messages are generated. Either in a main boot or in an initramfs.
Having property time-stamped log messages is very important for
managing a large deployment.

If the system time is set by some script or systemd unit, then there
will always be all the things that need to run before that script or
unit can work. E.g., udev creating rtc device nodes, mounting /sys and
/proc, systemd generator for local file system unis, the other parts of
systemd to do that, etc. All this won't be able to log with correct
system time.