[Arm-dev] We need to consider system time

Sun Dec 20 03:12:15 UTC 2015
Robert Moskowitz <rgm at htt-consult.com>

Most armv7 boards lack a battery to maintain system time.  On firstboot 
they come up a zero time.  This results in the initial log files (and 
other key files) to have a zero date:

# ls /var/log/ -lst
total 260
84 -rw-------. 1 root root  82722 Dec 19 21:45 messages
  8 -rw-------. 1 root root   4889 Dec 18 16:27 secure
16 -rw-------. 1 root root  14517 Dec 18 16:01 cron
  4 drwx------. 2 root root   4096 Dec 18 00:38 httpd
24 -rw-------. 1 root root  19279 Dec 18 00:37 yum.log
  0 -rw-------. 1 root root      0 Dec  3 09:07 spooler
  0 -rw-------. 1 root root      0 Dec  3 09:05 tallylog
  4 drwx------. 2 root root   4096 May 28  2015 ppp
  4 -rw-------. 1 root utmp   1152 Dec 31  1969 btmp
16 -rw-rw-r--. 1 root utmp  13824 Dec 31  1969 wtmp
  4 -rw-------. 1 root root    200 Dec 31  1969 maillog
28 -rw-r--r--. 1 root root 292292 Dec 31  1969 lastlog
  4 drwxr-xr-x. 2 root root   4096 Dec 31  1969 tuned
  4 -rw-r--r--. 1 root root    120 Dec 31  1969 wpa_supplicant.log
  4 drwxr-x---. 2 root root   4096 Dec 31  1969 audit
  8 -rw-r--r--. 1 root root   8180 Dec 31  1969 boot.log
24 -rw-r--r--. 1 root root  23322 Dec 31  1969 dmesg
24 -rw-r--r--. 1 root root  23322 Dec 31  1969 dmesg.old


Logwatch will have problems with these files (or that has been my prior 
experience).  I suspect other services will have problems with such 
'old' files on the system.

First we need to select the time management service:  ntp or timesync (I 
think I got this service naed correctly)?

Fedora is using timesync and gets the current proper time from the 
network shortly after bootup.  But there are some problems with this 
that are not so much an issue for a desktop, but are for a server.

The firstboot timestamping problem I show above still occurs.
Fedora has a later version of timesync that has this function.  The 
version in Centos7 does not.
What happens when a server restarts after a power outage, but before the 
external network access is available?  For some time the system runs 
with time zero+.

Here is what I am thinking as the way to address this:

The time services have the ability to read a file for a date hint if the 
date is less than some set time, or that is what I understand. So add to 
the centos-arm-installer script (to be made for the fedora-arm-installer 
script) a set to get the date from the installing system and pushing it 
into the proper place of the centos7-arm image.

Now at first boot, the system SHOULD come up with this date which is at 
least a good start that will tend to not be too stale.

Next this date file should be updated through some automatic process so 
in the event that a system is turned off then reboots, it comes up with 
a rather good start time.

I don't know what would be a good way to do this on Centos7.  I can 
search back in my various discussions on this subject on a couple of 
lists.  But there are people here that I hope are better able to make 
the design decisions needed so that our Centos7-armv7 systems have good 
time.