|
|
|
|
|
When first turned on, a computer system has to get the correct time from an independent source. On desktop and portable computers, there are usually two sources: a real-time clock (RTC) and any one of many Network Time Protocol (NTP) servers or Simple Network Time Protocol (SNTP) servers found on the Internet. Like many other single board computers, the family of Raspberry Pi board does not have an RTC and may not be connected to a network at all or may not have access to the Internet. The Raspberry Pi which at that heart of our home automation system does have an after-market RTC and does have access to the Internet, yet problems related to time keeping have occurred.
The battery of an the RTC has a limited life span. Power outages due to inclement weather are inevitable. Such are the vicissitudes of the computer hobbyist's life. It can get as bad as in a country western song: my clock is dead, and my Internet won't talk to me. Let's be serious; there are worse catastrophes. Nevertheless, I was taken aback when Domoticz would shut down immediately upon starting after a "cold start" (the initial boot after power is turned on) because of a dead RTC battery. This incident, and the need to install an RTC on a new Raspbian Buster Lite installation are the root causes of my newly found interest in Linux time keeping. Thought a definitive solution to avoid this problem has yet to materialize, but I decided to document what I have found out so far.
Table of Contents
Linux Date
The command line utility date is used to read or set the
system date and time. To show the current local time (to the best knowledge
of the operating system) in a format corresponding to the current locale,
simply enter the command without any option.
If option -u (or -utc) is added, the date and
time are displayed in universal time coordinates. It is also possible to
specify the TZ (time zone) environment variable to get the local
time in the specified zone.
It is possible to set the format used to display the time
That particular format, corresponds to what is needed to set the time. Formatting could be more complex.
See the man page for details about the date and time
format strings. They always begin with the "+" character and use
"%" as an escape character to start a sequence identifying a time or
date element to display.
To set the time, use the -s option.
If it is more convenient to set the time using universal coordinated
time, then use the -u option.
Here is some additional information not really necessary for what
follows. Time zone information is kept in a directory called
/usr/share/zoneinfo/. It contains directories for each region of
the globe. For instance is content for the time zones covering the Americas.
Instead of using time zone names, important cities in each time zone are
identified.
The current system timezone is a symbolic link to a city found in the time zone information directories.
While the date utility is quite valuable, it does not know
the actual time. It can only display or set the system time. So the
question remains "how does the system determine the
correct time?"
Fake Clock
There is no real-time clock (RTC) on the Raspberry Pi. Instead, two
software services, fake-hwclock and
systemd-timesyncd try to provide a clock. So this investigation
will start by looking at the "fake clock". In my humble opinion,
fake-hwclock has a clear man page which is helpful
for a neophyte like me. I suggest reading it.
To summarize, fake-hwclock (a dash script found in
/sbin on Debian systems) saves the current date and time in a
file named /etc/fake-hwclock.data just as the system is shutting
down. When the system is starting, fake-hwclock sets the system
time using the saved time and date from /etc/fake-hwclock.data.
Also once an hour, it updates the date and time saved in
/etc/fake-hwclock.data. With this last measure there's some
assurance that that the time is advanced even if the system did not shutdown
properly, should a power outage occur for example.
Here is a simplified version of the code that saves the system time as
UTC time in hwclock.data and later reads it from the file and
uses it to set the system time. The command line options save
and load determine which operation is performed.
A systemd unit file instructs fake-hwclock to
load the date at startup (ExecStart) and to save it
at shutdown (ExecStop).
As can be seen the unit file is setting using an environment variable
named FORCE as an option when loading the system time at boot
from the /etc/fake-hwclock.data file. The default configuration
file that will be used to define the value of FORCE does not
define that variable.
By default then, the load command issued by fake-hwclock.service
at boot time will be fake-hwclock load. That means that a
sanity check will be performed by fake-hwclock and it will
not set the system time to any date prior to midnight 2016-04-15 even if
/etc/fake-hwclock.data contained an older date.
Let's experiment with changes to the date and time to see how these
impact the system time on reboot when no RTC is connected to the Raspberry Pi
and when the Internet cannot be accessed. We begin by moving the time ahead
from Nov. 13 to Nov. 16 at noon. After waiting about 18 minutes, the time in
hwclock.data was updated to 16:17:41 UTC (12:17:41 local
time).
After waiting a couple of minutes, the system was rebooted and then time was checked again.
The time in hwclock.data was updated to 2019-11-16 16:19:26
(12:19:26 local time) during the shutdown process and then read back from the
file early in the boot process. When the date command was issued
the time had progressed to 12:20:27. This shows fake-hwclock
performing its task of moving a record of the system time forward.
Let's move the time backwards, but not so far back as to run afoul of
fake-hwclock sanity check.
After waiting a couple of minutes, the system was rebooted and then time was checked again.
Now that is a surprising result. The time according to fake-hwclock
and the system was moved back to about 12:28 on Oct. 13 before rebooting
yet the time and date after booting was Nov 13 15:37. How can that be? Looking
at the system logs reveals that systemd-timesyncd manipulated the
date even though it could not access the Internet.
More to come...
woopi@goldserver:~$ journalctl --no-pager | grep -i clock Nov 13 15:34:18 goldserver systemd[1]: System time before build time, advancing clock. -----rtc with dead battery, no net ---------- goldserver login: woopi Password: Last login: Wed Nov 13 15:35:35 AST 2019 on ttyS0 Linux goldserver 4.19.75-v7+ #1270 SMP Tue Sep 24 18:45:11 BST 2019 armv7l The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. woopi@goldserver:~$ date Wed 13 Nov 15:35:20 AST 2019 woopi@goldserver:~$ sudo hwclock -r 1999-12-31 20:01:31.093155-04:00 woopi@goldserver:~$ ls 0.txt 1.txt 2.txt 3.txt 4.txt 5.txt woopi@goldserver:~$ cat *txt at /run/systemd/system got to 1 got to 2 got to 3 loaded /etc/default/hwclok running hwclock (/dev/rtc0) woopi@goldserver:~$ ls -l total 24 -rw-r--r-- 1 root root 23 Nov 13 15:37 0.txt -rw-r--r-- 1 root root 9 Nov 13 15:37 1.txt -rw-r--r-- 1 root root 9 Nov 13 15:37 2.txt -rw-r--r-- 1 root root 9 Nov 13 15:37 3.txt -rw-r--r-- 1 root root 27 Nov 13 15:37 4.txt -rw-r--r-- 1 root root 28 Nov 13 15:37 5.txt woopi@goldserver:~$ date Wed 13 Nov 15:38:24 AST 2019 woopi@goldserver:~$ sudo hwclock -r 1999-12-31 20:04:29.626298-04:00 woopi@goldserver:~$ ls -l total 24 -rw-r--r-- 1 root root 23 Nov 13 15:37 0.txt -rw-r--r-- 1 root root 9 Nov 13 15:37 1.txt -rw-r--r-- 1 root root 9 Nov 13 15:37 2.txt -rw-r--r-- 1 root root 9 Nov 13 15:37 3.txt -rw-r--r-- 1 root root 27 Nov 13 15:37 4.txt -rw-r--r-- 1 root root 28 Nov 13 15:37 5.txt woopi@goldserver:~$ date Wed 13 Nov 15:38:58 AST 2019 woopi@goldserver:~$ dmesg | grep -i time [ 0.000000] arch_timer: cp15 timer(s) running at 19.20MHz (phys). [ 0.000023] Switching to timer-based delay loop, resolution 52ns [ 0.000971] Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIP) [ 0.219276] workingset: timestamp_bits=14 max_order=18 bucket_order=4 [ 0.827354] bcm2835-wdt bcm2835-wdt: Broadcom BCM2835 watchdog timer [ 3.067587] systemd[1]: System time before build time, advancing clock. [ 5.256728] systemd-journald[106]: Received request to flush runtime journal from PID 1 [ 6.716001] rtc-ds1307 1-0068: SET TIME! dmesg | grep -i rtc [ 6.716001] rtc-ds1307 1-0068: SET TIME! [ 6.719418] rtc-ds1307 1-0068: registered as rtc0 woopi@goldserver:~$ journalctl --no-pager | grep -i rtc Nov 13 15:37:16 goldserver kernel: rtc-ds1307 1-0068: SET TIME! Nov 13 15:37:16 goldserver kernel: rtc-ds1307 1-0068: registered as rtc0 woopi@goldserver:~$ journalctl --no-pager | grep -i time Nov 13 15:37:14 goldserver kernel: arch_timer: cp15 timer(s) running at 19.20MHz (phys). Nov 13 15:37:14 goldserver kernel: Switching to timer-based delay loop, resolution 52ns Nov 13 15:37:14 goldserver kernel: Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=192000) Nov 13 15:37:14 goldserver kernel: workingset: timestamp_bits=14 max_order=18 bucket_order=4 Nov 13 15:37:14 goldserver kernel: bcm2835-wdt bcm2835-wdt: Broadcom BCM2835 watchdog timer Nov 13 15:37:14 goldserver systemd[1]: System time before build time, advancing clock. Nov 13 15:37:14 goldserver systemd-journald[106]: Runtime journal (/run/log/journal/f77133b8ac624a31a8141c75e812672e) is 6.0M, max 48.7M, 42.6M free. Nov 13 15:37:14 goldserver systemd-fsck[124]: Superblock last mount time is in the future. Nov 13 15:37:14 goldserver systemd-fsck[124]: Superblock last write time is in the future. Nov 13 15:37:14 goldserver systemd-journald[106]: Runtime journal (/run/log/journal/f77133b8ac624a31a8141c75e812672e) is 6.0M, max 48.7M, 42.6M free. Nov 13 15:37:16 goldserver kernel: rtc-ds1307 1-0068: SET TIME! Dec 31 20:00:12 goldserver systemd[1]: Starting Network Time Synchronization... Dec 31 20:00:12 goldserver systemd-timesyncd[265]: System clock time unset or jumped backwards, restoring from recorded timestamp: Wed 2019-11-13 15:34:18 AST Nov 13 15:34:18 goldserver systemd[1]: Started Network Time Synchronization. Nov 13 15:34:18 goldserver systemd[1]: Reached target System Time Synchronized. Nov 13 15:34:18 goldserver systemd[1]: Reached target Timers. Nov 13 15:34:49 goldserver dhcpcd[324]: timed out Nov 13 15:34:49 goldserver dhcpcd[324]: timed out Nov 13 15:35:07 goldserver systemd[1]: Starting User Runtime Directory /run/user/1000... Nov 13 15:35:07 goldserver systemd[1]: Started User Runtime Directory /run/user/1000. Nov 13 15:35:08 goldserver systemd[458]: Reached target Timers. woopi@goldserver:~$ journalctl --no-pager | grep -i clock Nov 13 15:37:14 goldserver kernel: clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x46d987e47, max_idle_ns: 440795202767 ns Nov 13 15:37:14 goldserver kernel: sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 4398046511078ns Nov 13 15:37:14 goldserver kernel: clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns Nov 13 15:37:14 goldserver kernel: clocksource: Switched to clocksource arch_sys_counter Nov 13 15:37:14 goldserver systemd[1]: System time before build time, advancing clock. Nov 13 15:37:14 goldserver fake-hwclock[101]: Wed 13 Nov 19:37:14 UTC 2019 Nov 13 15:37:14 goldserver systemd-fsck[124]: (by less than a day, probably due to the hardware clock being incorrectly set) Nov 13 15:37:14 goldserver systemd-fsck[124]: (by less than a day, probably due to the hardware clock being incorrectly set) Dec 31 20:00:12 goldserver systemd-timesyncd[265]: System clock time unset or jumped backwards, restoring from recorded timestamp: Wed 2019-11-13 15:34:18 AST ------------------- no rtc, no net ------------------------------------- Last login: Wed Nov 13 15:35:07 AST 2019 on ttyS0 Linux goldserver 4.19.75-v7+ #1270 SMP Tue Sep 24 18:45:11 BST 2019 armv7l The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. woopi@goldserver:~$ date Wed 13 Nov 15:49:21 AST 2019 --- real date Wed 13 Nov 16:53 AST 2019 woopi@goldserver:~$ woopi@goldserver:~$ ls /dev/rt* ls: cannot access '/dev/rt*': No such file or directory woopi@goldserver:~$ dmesg | grep -i -E "time|clock|rtc|i2c" [ 0.000000] arch_timer: cp15 timer(s) running at 19.20MHz (phys). [ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x46d987e47, max_idle_ns: 440795202767 ns [ 0.000007] sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 4398046511078ns [ 0.000023] Switching to timer-based delay loop, resolution 52ns [ 0.000971] Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=192000) [ 0.021682] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns [ 0.111738] clocksource: Switched to clocksource arch_sys_counter [ 0.219155] workingset: timestamp_bits=14 max_order=18 bucket_order=4 [ 0.827262] bcm2835-wdt bcm2835-wdt: Broadcom BCM2835 watchdog timer [ 3.056582] systemd[1]: System time before build time, advancing clock. [ 5.232990] systemd-journald[112]: Received request to flush runtime journal from PID 1 [ 6.714487] rtc-ds1307: probe of 1-0068 failed with error -121 woopi@goldserver:~$ journalctl --no-pager | grep -i -E "time|clock|rtc|i2c" Nov 13 15:47:46 goldserver kernel: arch_timer: cp15 timer(s) running at 19.20MHz (phys). Nov 13 15:47:46 goldserver kernel: clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x46d987e47, max_idle_ns: 440795202767 ns Nov 13 15:47:46 goldserver kernel: sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 4398046511078ns Nov 13 15:47:46 goldserver kernel: Switching to timer-based delay loop, resolution 52ns Nov 13 15:47:46 goldserver kernel: Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=192000) Nov 13 15:47:46 goldserver kernel: clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns Nov 13 15:47:46 goldserver kernel: clocksource: Switched to clocksource arch_sys_counter Nov 13 15:47:46 goldserver kernel: workingset: timestamp_bits=14 max_order=18 bucket_order=4 Nov 13 15:47:46 goldserver kernel: bcm2835-wdt bcm2835-wdt: Broadcom BCM2835 watchdog timer Nov 13 15:47:46 goldserver systemd[1]: System time before build time, advancing clock. Nov 13 15:47:46 goldserver systemd-journald[112]: Runtime journal (/run/log/journal/f77133b8ac624a31a8141c75e812672e) is 6.0M, max 48.7M, 42.6M free. Nov 13 15:47:46 goldserver fake-hwclock[101]: Wed 13 Nov 19:47:46 UTC 2019 Nov 13 15:47:46 goldserver systemd-journald[112]: Runtime journal (/run/log/journal/f77133b8ac624a31a8141c75e812672e) is 6.0M, max 48.7M, 42.6M free. Nov 13 15:47:48 goldserver kernel: rtc-ds1307: probe of 1-0068 failed with error -121 Nov 13 15:47:49 goldserver systemd[1]: Starting Network Time Synchronization... Nov 13 15:47:49 goldserver systemd[1]: Started Network Time Synchronization. Nov 13 15:47:50 goldserver systemd[1]: Reached target System Time Synchronized. Nov 13 15:47:50 goldserver systemd[1]: Reached target Timers. Nov 13 15:48:21 goldserver dhcpcd[298]: timed out Nov 13 15:48:21 goldserver dhcpcd[298]: timed out Nov 13 15:49:13 goldserver systemd[1]: Starting User Runtime Directory /run/user/1000... Nov 13 15:49:13 goldserver systemd[1]: Started User Runtime Directory /run/user/1000. Nov 13 15:49:13 goldserver systemd[447]: Reached target Timers. -----rtc with dead battery, no net ---------- goldserver login: woopi Password: Last login: Wed Nov 13 15:49:13 AST 2019 on ttyS0 Linux goldserver 4.19.75-v7+ #1270 SMP Tue Sep 24 18:45:11 BST 2019 armv7l The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. woopi@goldserver:~$ date Wed 13 Nov 15:35:06 AST 2019 woopi@goldserver:~$ ls /dev/rt* /dev/rtc /dev/rtc0 woopi@goldserver:~$ dmesg | grep -i -E "time|clock|rtc|i2c" [ 0.000000] arch_timer: cp15 timer(s) running at 19.20MHz (phys). [ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x46d987e47, max_idle_ns: 440795202767 ns [ 0.000007] sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 4398046511078ns [ 0.000023] Switching to timer-based delay loop, resolution 52ns [ 0.000971] Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=192000) [ 0.021661] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns [ 0.111757] clocksource: Switched to clocksource arch_sys_counter [ 0.219076] workingset: timestamp_bits=14 max_order=18 bucket_order=4 [ 0.827274] bcm2835-wdt bcm2835-wdt: Broadcom BCM2835 watchdog timer [ 3.060965] systemd[1]: System time before build time, advancing clock. [ 5.259998] systemd-journald[103]: Received request to flush runtime journal from PID 1 [ 6.767709] rtc-ds1307 1-0068: SET TIME! [ 6.770050] rtc-ds1307 1-0068: registered as rtc0 woopi@goldserver:~$ journalctl --no-pager | grep -i -E "time|clock|rtc|i2c" Nov 13 15:58:35 goldserver kernel: arch_timer: cp15 timer(s) running at 19.20MHz (phys). Nov 13 15:58:35 goldserver kernel: clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x46d987e47, max_idle_ns: 440795202767 ns Nov 13 15:58:35 goldserver kernel: sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 4398046511078ns Nov 13 15:58:35 goldserver kernel: Switching to timer-based delay loop, resolution 52ns Nov 13 15:58:35 goldserver kernel: Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=192000) Nov 13 15:58:35 goldserver kernel: clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns Nov 13 15:58:35 goldserver kernel: clocksource: Switched to clocksource arch_sys_counter Nov 13 15:58:35 goldserver kernel: workingset: timestamp_bits=14 max_order=18 bucket_order=4 Nov 13 15:58:35 goldserver kernel: bcm2835-wdt bcm2835-wdt: Broadcom BCM2835 watchdog timer Nov 13 15:58:35 goldserver systemd[1]: System time before build time, advancing clock. Nov 13 15:58:35 goldserver systemd-journald[103]: Runtime journal (/run/log/journal/f77133b8ac624a31a8141c75e812672e) is 6.0M, max 48.7M, 42.6M free. Nov 13 15:58:35 goldserver fake-hwclock[102]: Wed 13 Nov 19:58:35 UTC 2019 Nov 13 15:58:35 goldserver systemd-journald[103]: Runtime journal (/run/log/journal/f77133b8ac624a31a8141c75e812672e) is 6.0M, max 48.7M, 42.6M free. Nov 13 15:58:37 goldserver kernel: rtc-ds1307 1-0068: SET TIME! Nov 13 15:58:37 goldserver kernel: rtc-ds1307 1-0068: registered as rtc0 Dec 31 20:00:20 goldserver systemd[1]: Starting Network Time Synchronization... Dec 31 20:00:21 goldserver systemd-timesyncd[265]: System clock time unset or jumped backwards, restoring from recorded timestamp: Wed 2019-11-13 15:34:18 AST Nov 13 15:34:18 goldserver systemd[1]: Started Network Time Synchronization. Nov 13 15:34:18 goldserver systemd[1]: Reached target System Time Synchronized. Nov 13 15:34:18 goldserver systemd[1]: Reached target Timers. Nov 13 15:34:49 goldserver dhcpcd[307]: timed out Nov 13 15:34:49 goldserver dhcpcd[307]: timed out Nov 13 15:35:02 goldserver systemd[1]: Starting User Runtime Directory /run/user/1000... Nov 13 15:35:02 goldserver systemd[1]: Started User Runtime Directory /run/user/1000. Nov 13 15:35:02 goldserver systemd[457]: Reached target Timers. woopi@goldserver:~$ ls -l /var/lib/systemd/timesync total 0 -rw-r--r-- 1 systemd-timesync systemd-timesync 0 Nov 13 15:34 clock --looks like systemd-journald keeps its own time stamp independant of fake-hwclock -----rtc with good battery, no net ---------- Password: Last login: Wed Nov 13 15:35:02 AST 2019 on ttyS0 Linux goldserver 4.19.75-v7+ #1270 SMP Tue Sep 24 18:45:11 BST 2019 armv7l The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. woopi@goldserver:~$ date Wed 13 Nov 17:32:23 AST 2019 woopi@goldserver:~$ ls /dev/rt* /dev/rtc /dev/rtc0 oopi@goldserver:~$ dmesg | grep -i -E "time|clock|rtc|i2c" [ 0.000000] arch_timer: cp15 timer(s) running at 19.20MHz (phys). [ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x46d987e47, max_idle_ns: 440795202767 ns [ 0.000007] sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 4398046511078ns [ 0.000023] Switching to timer-based delay loop, resolution 52ns [ 0.000971] Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=192000) [ 0.021678] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns [ 0.111775] clocksource: Switched to clocksource arch_sys_counter [ 0.219289] workingset: timestamp_bits=14 max_order=18 bucket_order=4 [ 0.827019] bcm2835-wdt bcm2835-wdt: Broadcom BCM2835 watchdog timer [ 3.056618] systemd[1]: System time before build time, advancing clock. [ 5.264132] systemd-journald[108]: Received request to flush runtime journal from PID 1 [ 6.839044] rtc-ds1307 1-0068: registered as rtc0 woopi@goldserver:~$ journalctl --no-pager | grep -i -E "time|clock|rtc|i2c" Nov 13 15:49:02 goldserver kernel: arch_timer: cp15 timer(s) running at 19.20MHz (phys). Nov 13 15:49:02 goldserver kernel: clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x46d987e47, max_idle_ns: 440795202767 ns Nov 13 15:49:02 goldserver kernel: sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 4398046511078ns Nov 13 15:49:02 goldserver kernel: Switching to timer-based delay loop, resolution 52ns Nov 13 15:49:02 goldserver kernel: Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=192000) Nov 13 15:49:02 goldserver kernel: clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns Nov 13 15:49:02 goldserver kernel: clocksource: Switched to clocksource arch_sys_counter Nov 13 15:49:02 goldserver kernel: workingset: timestamp_bits=14 max_order=18 bucket_order=4 Nov 13 15:49:02 goldserver kernel: bcm2835-wdt bcm2835-wdt: Broadcom BCM2835 watchdog timer Nov 13 15:49:02 goldserver systemd[1]: System time before build time, advancing clock. Nov 13 15:49:02 goldserver systemd-journald[108]: Runtime journal (/run/log/journal/f77133b8ac624a31a8141c75e812672e) is 6.0M, max 48.7M, 42.6M free. Nov 13 15:49:02 goldserver fake-hwclock[97]: Wed 13 Nov 19:49:02 UTC 2019 Nov 13 15:49:02 goldserver systemd-fsck[125]: Superblock last mount time is in the future. Nov 13 15:49:02 goldserver systemd-fsck[125]: (by less than a day, probably due to the hardware clock being incorrectly set) Nov 13 15:49:02 goldserver systemd-journald[108]: Runtime journal (/run/log/journal/f77133b8ac624a31a8141c75e812672e) is 6.0M, max 48.7M, 42.6M free. Nov 13 15:49:04 goldserver kernel: rtc-ds1307 1-0068: registered as rtc0 Nov 13 15:49:06 goldserver systemd[1]: Starting Network Time Synchronization... Nov 13 17:31:16 goldserver systemd[1]: Started Network Time Synchronization. Nov 13 17:31:16 goldserver systemd[1]: Reached target System Time Synchronized. Nov 13 17:31:16 goldserver systemd[1]: Reached target Timers. Nov 13 17:31:50 goldserver dhcpcd[315]: timed out Nov 13 17:31:50 goldserver dhcpcd[315]: timed out Nov 13 17:32:20 goldserver systemd[1]: Starting User Runtime Directory /run/user/1000... Nov 13 17:32:20 goldserver systemd[1]: Started User Runtime Directory /run/user/1000. Nov 13 17:32:20 goldserver systemd[456]: Reached target Timers. woopi@goldserver:~$ woopi@goldserver:~$ ls -l /var/lib/systemd/timesync total 0 -rw-r--r-- 1 systemd-timesync systemd-timesync 0 Nov 13 15:34 clock woopi@goldserver:~$ date; sudo hwclock -r Wed 13 Nov 17:37:21 AST 2019 2019-11-13 17:37:33.906765-04:00 woopi@goldserver:~$ sudo ls -l /run/systemd/timesync/ total 0 no synchronization, yet RTC gave good date ///////////////// woopi@goldserver:~$ /lib/systemd/systemd-time-wait-sync adjtime state 5 status 40 time Wed 2019-11-13 21:47:47.816793 UTC How can I delay the startup of systemd services until the datetime is set (no RTC on the Raspberry Pi) https://raspberrypi.stackexchange.com/questions/94635/how-can-i-delay-the-startup-of-systemd-services-until-the-datetime-is-set-no-rt maybe [Unit] Description=SDS011 Feinstaub Sensor After=time-sync.target Wants=time-sync.target SO if network down, Raspberry Read Only File System https://gist.github.com/Lahorde/d459695668ed299beec5af20dd34f0f4#description