On Tue, Sep 01, 2015 at 03:36:40PM -0400, Robert Moskowitz wrote:
Anyway. If I boot up without a network connection, the time stays at
Jan 1 1970.
I then set the time with the 'date' command and did:
touch /var/lib/systemd/clock
chown systemd-timesync:systemd-timesync /var/lib/systemd/clock
And rebooted. Time is once again at Jan 1 1970. I checked:
# ls -ls /var/lib/systemd/
total 16
4 drwxr-xr-x. 2 root root 4096 Aug 23 13:39 catalog
0 -rw-r--r--. 1 systemd-timesync systemd-timesync 0 Sep 1 15:27 clock
4 drwxr-xr-x. 2 root root 4096 May 21 15:06 coredump
4 -rw-------. 1 root root 512 Jan 1 1970
random-seed
4 drwxr-xr-x. 2 root root 4096 Aug 23 13:58 timers
So clock has a good timestamp. Maybe the wrong chown names? Or
something still yet?
Is systemd-timesyncd actually running? You need to disable chronyd
first as the two services conflict with each other.
But you don't need to switch to timesyncd to initialize the system
time from a file on boot, chronyd will do that too with the -s option
when RTC is missing.
Create /etc/sysconfig/chronyd if it doesn't exist and put OPTIONS="-s"
there. It seems you do have an RTC, but you don't want to use it
as it keeps bad time, so you will also need to tell chronyd to ignore
it, for example by adding "rtcdevice /dev/nonexist" to
/etc/chrony.conf. On boot chronyd should now set the system time to
the modification time of /var/lib/chrony/drift.
--
Miroslav Lichvar