On Fri, Feb 19, 2021 at 12:30:12PM +0100, Karel Zak wrote: > On Mon, Feb 15, 2021 at 10:16:30AM +0100, Karel Zak wrote: > > On Fri, Feb 12, 2021 at 11:04:59AM -0600, Bruce Dubbs wrote: > > > I don't recall if this has come up before, but I suggest a couple of changes > > > to the default util-linux build configuuration: > > > > > > 1. Change the default ADJTIME_PATH to be /var/lib/hwclock/adjtime > > > > Good idea. I'll do that. > > Hmm... I remembered now that we have in our TODO: > > hwclock > ------ > - use /var/lib/hwclock/drift to store hw-clock drift numbers. > - use /etc/adjtime as read-only for UTC/LOCAL information only > - the /var/lib/hwclock/drift should be implemented backwardly compatible, > it means use the file only if exists, otherwise follow /etc/adjtime > > so maybe the best would be to keep ADJTIME_PATH=/etc/adjtime and use > it as read-only and use ${localstatedir}/lib/hwclock/drift for the > rest. > > Note that ADJTIME_PATH is used by more utils, like rtcwake or systemd, > so move it is not so easy. OK, I have implemented it, but frankly, I'm not sure about it ;-) I have added William to CC:, maybe he will come with comments. See https://github.com/karelzak/util-linux/tree/topic/hwclock-drift-file branch. The idea is to keep /etc/adjtime as a source for UTC/LOCAL flag, but hwclock drift info (which we need to update occasionally) move to /var/lib/hwclock/drift. The /etc/adjtime is de-facto standard and move it means that 3rd party utils will have no way how to determine hwclock UTC/LOCAL mode. Both files use "adjtime" file format to make it simple to convert from one to another. The change should be backwardly compatible. If you do not have /var/lib/hwclock/drift then it falls back to /etc/adjtime. I'm not sure if this is not over-engineering. Maybe the current solution is good enough, and all we need is to make it more use-friendly to set ADJTIME_PATH for users like Bruce (although maintain any status information in /etc (in the year 2021) is not nice. The another possibility is to make a real change. Introduce completely new file in /etc (/etc/clockmode) with only UTC/LOCAL(, force all applications to use it (I know about rtcwake and systemd), and keep /var/lib/hwclock/drift as private hwclock(1) file in a private format. Karel -- Karel Zak <kzak@xxxxxxxxxx> http://karelzak.blogspot.com