After upgrading to glibc 2.31-1 I get an error at boot
hwclock: settimeofday() failed: Invalid argument
* Failed to set the system clock
Downgrading glibc to 2.30-3 solves this.
https://sourceware.org/ml/libc-announce/2020/msg00001.html
Looks related.
Thanks. So this is an openrc bug, right (since the error is reported in /var/log/rc.log)? Does this mean I can do nothing about it except wait for an update? Can I ignore it, since the clock seems to be working? I just got a "bad gateway" error trying to log in, is this time-related? (I'm now back to glibc-2.30-3, I don't know if that solved the error)
I'd guess it's a bug in hwclock. But that really is nothing more than a guess...
I think the only effect of this is that the system time isn't being loaded from the computers hardware clock chip at boot. But if you run ntp, that shouldn't matter.
But, it could also be a bug in how openrc runs 'hwclock'.
According to the Gentoo "System time" wiki, I should delete the hwclock service from boot, since my kernel (and also the default kernel) has all the required options to set the time in-kernel:
On a sufficiently modern kernel (3.9 or newer), Linux can be configured to handle setting the system time automatically. To do so, enable the Set system time from RTC on startup and resume (CONFIG_RTC_HCTOSYS) and Set the RTC time based on NTP synchronization (CONFIG_RTC_SYSTOHC) kernel options:
Device Drivers --->
[*] Real Time Clock --->
[*] Set system time from RTC on startup and resume
(rtc0) RTC used to set the system time
[*] Set the RTC time based on NTP synchronization
(rtc0) RTC used to synchronize NTP adjustment
[*] /sys/class/rtc/rtcN (sysfs)
[*] /proc/driver/rtc (procfs for rtc0)
[*] /dev/rtcN (character devices)
<*> PC-style 'CMOS'
So I deleted the hwclock service. The time is correct after rebooting. I did not change /etc/conf.d/hwclock.
If the hwclock service is still activated by default, that should be changed.
hwclock has now been patched upstream:
https://github.com/karelzak/util-linux/commit/cd781c405be82540484da3bfe3d3f17a39b8eb5c (https://github.com/karelzak/util-linux/commit/cd781c405be82540484da3bfe3d3f17a39b8eb5c)
After the recent openrc update the hwclock service was readded, and I had to manually delete it again. I don't need it - system time works without it, and for mate-control-center I can install openrc-settingsd, which will open a proper authentication window (not that I need openrc-settingsd, I don't even need mate-control-center, but I keep it for convenience).
Is there a way of blacklisting the hwclock service, other than adding
NoExtract = etc/init.d/hwclock
to /etc/pacman.conf? This works, I successfully rebooted without error after reinstalling openrc, but it seems like overkill. A command like "rc-status set hwclock unused" would be nice.