On Wednesday, December 6, 2017 11:58:16 PM CET Freek de Kruijf wrote:
Op woensdag 6 december 2017 15:58:38 CET schreef Brüns, Stefan:
On Mittwoch, 6. Dezember 2017 15:23:19 CET Freek de Kruijf wrote:
In Raspbian I noticed a packet always included in the image called fake- hwclock. I used the tar.gz file together with a .spec file to generate this packet for openSUSE distributions for systems without a Real Time Clock.
The description is: Some machines don't have a working realtime clock (RTC) unit, or no driver for the hardware that does exist. fake-hwclock is a simple set of scripts to save the kernel's current clock periodically (including at shutdown) and restore it at boot so that the system clock keeps at least close to realtime. This will stop some of the problems that may be caused by a system believing it has travelled in time back to 1970, such as needing to perform file system checks at every boot.
On top of this, use of NTP is still recommended to deal with the fake clock "drifting" while the hardware is halted or rebooting.
Hope this is accepted to be included.
Does this offer anything beyond what systemd-timesyncd offers?
Don't know. I would expect, if this does the same as this package, by default to be included in images for systems without a Real Time Clock. I did not notice such a inclusion, but I struggled with dates Jan 1, 1970 after starting a Raspberry Pi using openSUSE, before NTP finally set the time proper. This packet sets the time very early in the boot process so times are beyond times last used before the system went down, at least after a proper shutdown. After a crash this time might be off less than one hour.
systemctl-timesyncd is not enabled by default (probably it should on e.g. the RPi images). Time will be saved to persistent storage on regular intervals after time has been set up from a reliable timesource - that is either NTP, or manually set with timedatectl. The timestamp file is also saved when timesyncd is stopped, i.e. on system shutdown. Contrary to the fake-hwclock script, it does not spawn external processes on each update, and it does not write the timestamp to the file but just uses the mtime inode field, so less writes on each update. Kind regards, Stefan -- Stefan Brüns / Bergstraße 21 / 52062 Aachen home: +49 241 53809034 mobile: +49 151 50412019