I'm trying to figure out all the different things that change the system clock at boot, and there appear to be a LOT of them.
So far, this is what I've been able to figure out:
The system comes pre-configured with systemd-timesyncd, which tries to get the current time over the internet at boot.
Even if you disable that with:
Code: Select all
systemctl stop systemd-timesyncd
systemctl disable systemd-timesyncd
Code: Select all
date --set "SEP 01 2000 00:00:00"
At boot, something still fixes the time, or at least tries to.
The most likely culprit is /etc/init.d/fake-hwclock, which systemd turns into a service dynamically using systemd-sysv-generator.
/etc/init.d/fake-hwclock uses /sbin/fake-hwclock to save the time at shutdown, and restore it at startup. It ensures that even if the clock isn't perfectly accurate, at least it won't appear to go backwards. Presumably this happens before NTP, and works even if internet is not available (unlike NTP). Makes sense.
Removing /etc/init.d/fake-hwclock, setting the date to the year 2000, and rebooting, something still fixes the clock.
Removing /sbin/fake-hwclock didn't help either.
Then, there's another init.d script - hwclock.sh. Not really sure what it does, but it's clearly time-related, so I got rid of that too. That didn't help either. A reboot still restores the clock to a fairly-recent date.
How many layers does one device need? What else is restoring the system clock at boot?