On May 16, 2015, at 12:58 PM, Rick Thomas <rbtho...@pobox.com> wrote:
> > On May 16, 2015, at 6:02 AM, Ben Hutchings <b...@decadent.org.uk> wrote: > >> This is not implemented directly by the init system. util-linux >> installs the script/lib/udev/hwclock-set and a udev rule that runs it >> for each RTC device. However, the hwclock-set script does nothing if >> systemd is running. > > curiouser and curiouser… > > Looking at the code in /lib/udev/hwclock-set, I can’t see that it would would > ever do anything useful (except by chance) in the case like mine where there > are two rtc devices, only one of which should actually be used to set system > time at boot. > > In particular, it goes to some effort to source /etc/default/rcS and > /etc/default/hwclock, but it pays no attention to the HCTOSYS_DEVICE > parameter. > > It appears to set the system time from each RTC device in turn as it > discovers them. So system time ends up set by the last RTC to be discovered. > If the right one happens to be last, that’s good. But that’s not guaranteed. Looking further, I find that what I said is not quite true. hwclock-set only gets called for /dev/rtc0, i.e. the *first* one to be discovered. This happens in /lib/udev/rules.d/85-hwclock.rules. There is provision in /lib/udev/rules.d/50-udev-default.rules to swing the /dev/rtc symlink to the device that has ATTR{hctosys}==“1”, but that doesn’t fix the problem at hand, because the symlink is not used anywhere in hwclock-set. Fascinating! Rick -- To UNSUBSCRIBE, email to debian-kernel-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/c4618e4b-58a9-4f5d-8cbd-7967f1a9c...@pobox.com