You are not logged in.
This archwiki article about system time says that the hardware clock is set from the system clock on shutdown.
I first assumed that this means "hwclock --systohc" is called on shutdown because that is exactly what it does: sets the hardware clock from the system clock. "man 8 hwclock" further supports this, saying "it is typical for systems to call 'hwclock --systohc' at shutdown." However, lines 1 and 2 of /etc/adjtime do not change on shutdown, although they are supposed to when "hwclock --systohc" is called.
If "hwclock --systohc" isn't called, then what happens on shutdown?
Last edited by sm1root (2023-08-06 05:18:16)
Offline
What does (or more importantly: did) your /etc/adjtime show before and after you run "hwclock --systohc"? As I read the man page, it seems this file might not change if your HW clock is accurate enough (or hwclock has not been run that many times yet).
As for what happens on shutdown, I don't know. I remember hw clock synchronization could be configured accordingly to all kinds of situations way back - but I presume things have changed since UEFI became the new standard. There is no need to determine anymore the time zone of the HW clock (as it is stored somewhere in UEFI variables?), and systemd stores the clock per default. My guess is that this is what time-set.target does, but I didn't find the documentation after a quick glance.
Last edited by Wild Penguin (2023-08-06 11:24:55)
Offline
If this article is correct, systemd does not set the time ever, including on exit.
It is possible that the language in the wiki, which refers to "operating systems" generally is not correct as it relates to generic Arch, which uses systemd and whose default kernel configuration sets SYSTOHTC.
Offline