How is system time set? Is ntpdate run after the network is ready? How long does it retry waiting for the network to be available?
I have seen a number of challenges becuase the system time is bac at the epoch start as there is no battery rtc. And I wonder how many armv7 boards have a battery to maintain time across boots?
Minimally, a process could right the time, in the proper format, to a file, say /etc/currenttime every 5 min and at shutdown.
Then date can be run early in the boot process, piping this file in. It would not be perfect and does not help, much for new installs, but better than epoch start.
Plus /etc/currenttime can be at least set to the image build date/time so not even firstboot will be at epoch start.
On Tue, Sep 1, 2015 at 11:10 AM, Robert Moskowitz rgm@htt-consult.com wrote:
How is system time set? Is ntpdate run after the network is ready? How long does it retry waiting for the network to be available?
I have seen a number of challenges becuase the system time is bac at the epoch start as there is no battery rtc. And I wonder how many armv7 boards have a battery to maintain time across boots?
Minimally, a process could right the time, in the proper format, to a file, say /etc/currenttime every 5 min and at shutdown.
Then date can be run early in the boot process, piping this file in. It would not be perfect and does not help, much for new installs, but better than epoch start.
Plus /etc/currenttime can be at least set to the image build date/time so not even firstboot will be at epoch start.
systemd v215+ has a nice feature to take care of this:
systemctl enable systemd-timesyncd.service
Regards,
On 09/01/2015 12:14 PM, Robert Nelson wrote:
On Tue, Sep 1, 2015 at 11:10 AM, Robert Moskowitz rgm@htt-consult.com wrote:
How is system time set? Is ntpdate run after the network is ready? How long does it retry waiting for the network to be available?
I have seen a number of challenges becuase the system time is bac at the epoch start as there is no battery rtc. And I wonder how many armv7 boards have a battery to maintain time across boots?
Minimally, a process could right the time, in the proper format, to a file, say /etc/currenttime every 5 min and at shutdown.
Then date can be run early in the boot process, piping this file in. It would not be perfect and does not help, much for new installs, but better than epoch start.
Plus /etc/currenttime can be at least set to the image build date/time so not even firstboot will be at epoch start.
systemd v215+ has a nice feature to take care of this:
systemctl enable systemd-timesyncd.service
Thanks! I see that this DOES work even when no network. It would be good if the images came with this enabled and with the time set to the build date/time, so we had a better starting time a firstboot.
On Tue, Sep 1, 2015 at 12:03 PM, Robert Moskowitz rgm@htt-consult.com wrote:
On 09/01/2015 12:14 PM, Robert Nelson wrote:
On Tue, Sep 1, 2015 at 11:10 AM, Robert Moskowitz rgm@htt-consult.com wrote:
How is system time set? Is ntpdate run after the network is ready? How long does it retry waiting for the network to be available?
I have seen a number of challenges becuase the system time is bac at the epoch start as there is no battery rtc. And I wonder how many armv7 boards have a battery to maintain time across boots?
Minimally, a process could right the time, in the proper format, to a file, say /etc/currenttime every 5 min and at shutdown.
Then date can be run early in the boot process, piping this file in. It would not be perfect and does not help, much for new installs, but better than epoch start.
Plus /etc/currenttime can be at least set to the image build date/time so not even firstboot will be at epoch start.
systemd v215+ has a nice feature to take care of this:
systemctl enable systemd-timesyncd.service
Thanks! I see that this DOES work even when no network. It would be good if the images came with this enabled and with the time set to the build date/time, so we had a better starting time a firstboot.
One little trick i've been doing before first boot:
touch /<mount>/var/lib/systemd/clock chown systemd-timesync:systemd-timesync /<mount>/var/lib/systemd/clock
Then systemd-timesyncd.service will use that time stamp..
Regards,
On 09/01/2015 01:06 PM, Robert Nelson wrote:
On Tue, Sep 1, 2015 at 12:03 PM, Robert Moskowitz rgm@htt-consult.com wrote:
On 09/01/2015 12:14 PM, Robert Nelson wrote:
On Tue, Sep 1, 2015 at 11:10 AM, Robert Moskowitz rgm@htt-consult.com wrote:
How is system time set? Is ntpdate run after the network is ready? How long does it retry waiting for the network to be available?
I have seen a number of challenges becuase the system time is bac at the epoch start as there is no battery rtc. And I wonder how many armv7 boards have a battery to maintain time across boots?
Minimally, a process could right the time, in the proper format, to a file, say /etc/currenttime every 5 min and at shutdown.
Then date can be run early in the boot process, piping this file in. It would not be perfect and does not help, much for new installs, but better than epoch start.
Plus /etc/currenttime can be at least set to the image build date/time so not even firstboot will be at epoch start.
systemd v215+ has a nice feature to take care of this:
systemctl enable systemd-timesyncd.service
Thanks! I see that this DOES work even when no network. It would be good if the images came with this enabled and with the time set to the build date/time, so we had a better starting time a firstboot.
One little trick i've been doing before first boot:
touch /<mount>/var/lib/systemd/clock chown systemd-timesync:systemd-timesync /<mount>/var/lib/systemd/clock
Then systemd-timesyncd.service will use that time stamp..
That would be easy to add to the Fedora-installer script.
On Tuesday, September 01, 2015 01:03:03 PM Robert Moskowitz wrote:
On 09/01/2015 12:14 PM, Robert Nelson wrote:
On Tue, Sep 1, 2015 at 11:10 AM, Robert Moskowitz rgm@htt-consult.com
wrote:
How is system time set? Is ntpdate run after the network is ready? How long does it retry waiting for the network to be available?
I have seen a number of challenges becuase the system time is bac at the epoch start as there is no battery rtc. And I wonder how many armv7 boards have a battery to maintain time across boots?
Minimally, a process could right the time, in the proper format, to a file, say /etc/currenttime every 5 min and at shutdown.
Then date can be run early in the boot process, piping this file in. It would not be perfect and does not help, much for new installs, but better than epoch start.
Plus /etc/currenttime can be at least set to the image build date/time so not even firstboot will be at epoch start.
systemd v215+ has a nice feature to take care of this:
systemctl enable systemd-timesyncd.service
Thanks! I see that this DOES work even when no network. It would be good if the images came with this enabled and with the time set to the build date/time, so we had a better starting time a firstboot.
Without a battery backed RTC its really not that useful. Picture 6 or 10 months after a release, does it matter if the time is half a year to a year off or 35 years off?
I am just trying to understand what problem you think this solves. chronyd or timesyncd should fix up the time as soon as you get a network connection.
Regards
Dennis
On 09/01/2015 02:38 PM, Dennis Gilmore wrote:
On Tuesday, September 01, 2015 01:03:03 PM Robert Moskowitz wrote:
On 09/01/2015 12:14 PM, Robert Nelson wrote:
On Tue, Sep 1, 2015 at 11:10 AM, Robert Moskowitz rgm@htt-consult.com
wrote:
How is system time set? Is ntpdate run after the network is ready? How long does it retry waiting for the network to be available?
I have seen a number of challenges becuase the system time is bac at the epoch start as there is no battery rtc. And I wonder how many armv7 boards have a battery to maintain time across boots?
Minimally, a process could right the time, in the proper format, to a file, say /etc/currenttime every 5 min and at shutdown.
Then date can be run early in the boot process, piping this file in. It would not be perfect and does not help, much for new installs, but better than epoch start.
Plus /etc/currenttime can be at least set to the image build date/time so not even firstboot will be at epoch start.
systemd v215+ has a nice feature to take care of this:
systemctl enable systemd-timesyncd.service
Thanks! I see that this DOES work even when no network. It would be good if the images came with this enabled and with the time set to the build date/time, so we had a better starting time a firstboot.
Without a battery backed RTC its really not that useful. Picture 6 or 10 months after a release, does it matter if the time is half a year to a year off or 35 years off?
I am just trying to understand what problem you think this solves. chronyd or timesyncd should fix up the time as soon as you get a network connection.
Ah, but the fedora-installer script can do the:
touch /<mount>/var/lib/systemd/clock chown systemd-timesync:systemd-timesync /<mount>/var/lib/systemd/clock
So it would have the time you built your mSD card.
Or so it seems.
I am doing some testing with F22 on a Cubieboard2.
timedatectl reports:
Local time: Tue 2015-09-01 15:32:05 EDT Universal time: Tue 2015-09-01 19:32:05 UTC RTC time: Thu 1970-01-01 00:04:04 Time zone: America/Detroit (EDT, -0400) NTP enabled: yes NTP synchronized: no RTC in local TZ: yes DST active: yes Last DST change: DST began at Sun 2015-03-08 01:59:59 EST Sun 2015-03-08 03:00:00 EDT Next DST change: DST ends (the clock jumps one hour backwards) at Sun 2015-11-01 01:59:59 EDT Sun 2015-11-01 01:00:00 EST
Warning: The system is configured to read the RTC time in the local time zone. This mode can not be fully supported. It will create various problems with time zone changes and daylight saving time adjustments. The RTC time is never updated, it relies on external facilities to maintain it. If at all possible, use RTC in UTC by calling 'timedatectl set-local-rtc 0'.
hmmm. What is this about this warning? All I did was select the timezone from the config screen...
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?
On 09/01/2015 02:38 PM, Dennis Gilmore wrote:
On Tuesday, September 01, 2015 01:03:03 PM Robert Moskowitz wrote:
On 09/01/2015 12:14 PM, Robert Nelson wrote:
On Tue, Sep 1, 2015 at 11:10 AM, Robert Moskowitz rgm@htt-consult.com
wrote:
How is system time set? Is ntpdate run after the network is ready? How long does it retry waiting for the network to be available?
I have seen a number of challenges becuase the system time is bac at the epoch start as there is no battery rtc. And I wonder how many armv7 boards have a battery to maintain time across boots?
Minimally, a process could right the time, in the proper format, to a file, say /etc/currenttime every 5 min and at shutdown.
Then date can be run early in the boot process, piping this file in. It would not be perfect and does not help, much for new installs, but better than epoch start.
Plus /etc/currenttime can be at least set to the image build date/time so not even firstboot will be at epoch start.
systemd v215+ has a nice feature to take care of this:
systemctl enable systemd-timesyncd.service
Thanks! I see that this DOES work even when no network. It would be good if the images came with this enabled and with the time set to the build date/time, so we had a better starting time a firstboot.
Without a battery backed RTC its really not that useful. Picture 6 or 10 months after a release, does it matter if the time is half a year to a year off or 35 years off?
I am just trying to understand what problem you think this solves. chronyd or timesyncd should fix up the time as soon as you get a network connection.
Regards
Dennis
arm mailing list arm@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/arm
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.
Thanks for this information. See below.
On 09/02/2015 04:42 AM, Miroslav Lichvar wrote:
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.
OH?!? I am running F22 with Xfce, last updated Aug 23. So whatever is in there wrt systemd-timesyscd and chronyd is what was in the image orginally plus whatever happened when I did the date/time config in the graphic configurator as part of the install (I go in and change my city from NYC to Detroit). A quick check shows:
#systemctl status systemd-timesyncd.service ● systemd-timesyncd.service - Network Time Synchronization Loaded: loaded (/usr/lib/systemd/system/systemd-timesyncd.service; disabled; vendor preset: disabled) Active: inactive (dead) Docs: man:systemd-timesyncd.service(8)
# systemctl -l status chronyd ● chronyd.service - NTP client/server Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled; vendor preset: enabled) Active: active (running) since Thu 1970-01-01 00:00:21 EST; 2min 57s ago Process: 482 ExecStartPost=/usr/libexec/chrony-helper update-daemon (code=exited, status=0/SUCCESS) Process: 451 ExecStart=/usr/sbin/chronyd $OPTIONS (code=exited, status=0/SUCCESS) Main PID: 459 (chronyd) CGroup: /system.slice/chronyd.service └─459 /usr/sbin/chronyd
Jan 01 00:00:19 vega.htt-consult.com systemd[1]: Starting NTP client/server... Jan 01 00:00:19 vega.htt-consult.com chronyd[459]: chronyd version 2.1.1 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +DEBUG +ASYNCDNS +IPV6 +SECHASH) Jan 01 00:00:20 vega.htt-consult.com chronyd[459]: Frequency -2.808 +/- 0.045 ppm read from /var/lib/chrony/drift Jan 01 00:00:21 vega.htt-consult.com systemd[1]: Started NTP client/server.
So it seems both are present, but only chronyd is running.
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.
I made these changes. In /etc/chrony.conf I now have:
# Enable kernel synchronization of the real-time clock (RTC). #rtcsync rtcdevice /dev/nonexist
I commented out the rtcsync line, given you told me to add the nonexist line. Hope that is correct.
Further, looking at this file I see that chronyd can act as an ntp server for other systems on the LAN? Important to know, no more ntpd then.
Perhaps these settings should be standard in our armv7 builds? Or an easy option to set them. A check box for 'no rtc' on that configurator?
On Wed, Sep 02, 2015 at 08:51:17AM -0400, Robert Moskowitz wrote:
OH?!? I am running F22 with Xfce, last updated Aug 23. So whatever is in there wrt systemd-timesyscd and chronyd is what was in the image orginally plus whatever happened when I did the date/time config in the graphic configurator as part of the install (I go in and change my city from NYC to Detroit). A quick check shows:
So it seems both are present, but only chronyd is running.
The chrony package is installed by default and the time configuration tool is enabling/disabling the chronyd service (via timedatex). To start timesyncd on boot you can either run "systemctl disable chronyd" and "systemctl enable timesyncd", or uninstall the chrony and timedatex packages and disable and enable the NTP checkbox again in the time config.
I made these changes. In /etc/chrony.conf I now have:
# Enable kernel synchronization of the real-time clock (RTC). #rtcsync rtcdevice /dev/nonexist
I commented out the rtcsync line, given you told me to add the nonexist line. Hope that is correct.
That shouldn't matter, if there is no battery for the RTC, there is probably no point in trying to keep the RTC synchronized.
Perhaps these settings should be standard in our armv7 builds? Or an easy option to set them. A check box for 'no rtc' on that configurator?
Maybe anaconda could do that. How common is to have a Fedora ARM machine without an RTC and how common it is to have an RTC, but no battery?
There is also a possibility to restore the time from a file in a separate service, without having to run an NTP client. On Debian, it's done by the fake-hwclock service. For Fedora there seems to be a Copr repo with it. I didn't try it.
https://copr.fedoraproject.org/coprs/jorti/fake-hwclock/
On Wednesday, September 02, 2015 03:46:55 PM Miroslav Lichvar wrote:
On Wed, Sep 02, 2015 at 08:51:17AM -0400, Robert Moskowitz wrote:
OH?!? I am running F22 with Xfce, last updated Aug 23. So whatever is in there wrt systemd-timesyscd and chronyd is what was in the image orginally plus whatever happened when I did the date/time config in the graphic configurator as part of the install (I go in and change my city from NYC to Detroit). A quick check shows:
So it seems both are present, but only chronyd is running.
The chrony package is installed by default and the time configuration tool is enabling/disabling the chronyd service (via timedatex). To start timesyncd on boot you can either run "systemctl disable chronyd" and "systemctl enable timesyncd", or uninstall the chrony and timedatex packages and disable and enable the NTP checkbox again in the time config.
I made these changes. In /etc/chrony.conf I now have:
# Enable kernel synchronization of the real-time clock (RTC). #rtcsync rtcdevice /dev/nonexist
I commented out the rtcsync line, given you told me to add the nonexist line. Hope that is correct.
That shouldn't matter, if there is no battery for the RTC, there is probably no point in trying to keep the RTC synchronized.
Perhaps these settings should be standard in our armv7 builds? Or an easy option to set them. A check box for 'no rtc' on that configurator?
Maybe anaconda could do that. How common is to have a Fedora ARM machine without an RTC and how common it is to have an RTC, but no battery?
Every arm device I have used has a rtc, but a very large number of them have no battery. some have two rtc devices and teh battery backed one ends up on /dev/rtc1
There is also a possibility to restore the time from a file in a separate service, without having to run an NTP client. On Debian, it's done by the fake-hwclock service. For Fedora there seems to be a Copr repo with it. I didn't try it.
chronyd in my use has always set the time correctly as soon as it has a working network connection.
any attempt to set the time based on something in the filesystem is going to result in the time being off. if it is something baked in at compose or image creation time the drift will get bigger over time. if it is some service that sets it on shutdown the drift will be small. network is required to get it accurate.
I would really like to know the use cases where chronyd is not sufficient and the problems that people are trying to solve.
Dennis
On Wed, Sep 02, 2015 at 09:29:27AM -0500, Dennis Gilmore wrote:
any attempt to set the time based on something in the filesystem is going to result in the time being off. if it is something baked in at compose or image creation time the drift will get bigger over time. if it is some service that sets it on shutdown the drift will be small. network is required to get it accurate.
I would really like to know the use cases where chronyd is not sufficient and the problems that people are trying to solve.
I think the purpose of saving and restoring system time from a file is to have monotonic time on machines that don't have a network connection or only have an intermittent connection, so messages in logs can be sorted, make doesn't complain timestamps are in future, etc.
On 09/02/2015 10:43 AM, Miroslav Lichvar wrote:
On Wed, Sep 02, 2015 at 09:29:27AM -0500, Dennis Gilmore wrote:
any attempt to set the time based on something in the filesystem is going to result in the time being off. if it is something baked in at compose or image creation time the drift will get bigger over time. if it is some service that sets it on shutdown the drift will be small. network is required to get it accurate.
I would really like to know the use cases where chronyd is not sufficient and the problems that people are trying to solve.
I think the purpose of saving and restoring system time from a file is to have monotonic time on machines that don't have a network connection or only have an intermittent connection, so messages in logs can be sorted, make doesn't complain timestamps are in future, etc.
I would tend to think that someone doing a make would have internet connection at that time. But there are so many other valid cases where proper timestamping is important and there was no internet connection at boot time to set the system time.
Also it would be nice if system boot log messages had a decent time stamp.
On Wednesday, September 02, 2015 04:43:19 PM Miroslav Lichvar wrote:
On Wed, Sep 02, 2015 at 09:29:27AM -0500, Dennis Gilmore wrote:
any attempt to set the time based on something in the filesystem is going to result in the time being off. if it is something baked in at compose or image creation time the drift will get bigger over time. if it is some service that sets it on shutdown the drift will be small. network is required to get it accurate.
I would really like to know the use cases where chronyd is not sufficient and the problems that people are trying to solve.
I think the purpose of saving and restoring system time from a file is to have monotonic time on machines that don't have a network connection or only have an intermittent connection, so messages in logs can be sorted, make doesn't complain timestamps are in future, etc.
Okay, in this case setting a time at image creation, or image installation is not sufficient. There would need to be some service that saves the time on poweroff and restores on powerup. though there will be a short period of time still where in many cases the logs have the epoch date/time l the service resets the time when there is no battery backed rtc.
I think that this should be an optional thing so to not interfere with battery backed rtc's
Dennis
On 09/02/2015 11:22 AM, Dennis Gilmore wrote:
On Wednesday, September 02, 2015 04:43:19 PM Miroslav Lichvar wrote:
On Wed, Sep 02, 2015 at 09:29:27AM -0500, Dennis Gilmore wrote:
any attempt to set the time based on something in the filesystem is going to result in the time being off. if it is something baked in at compose or image creation time the drift will get bigger over time. if it is some service that sets it on shutdown the drift will be small. network is required to get it accurate.
I would really like to know the use cases where chronyd is not sufficient and the problems that people are trying to solve.
I think the purpose of saving and restoring system time from a file is to have monotonic time on machines that don't have a network connection or only have an intermittent connection, so messages in logs can be sorted, make doesn't complain timestamps are in future, etc.
Okay, in this case setting a time at image creation, or image installation is not sufficient. There would need to be some service that saves the time on poweroff and restores on powerup. though there will be a short period of time still where in many cases the logs have the epoch date/time l the service resets the time when there is no battery backed rtc.
I think that this should be an optional thing so to not interfere with battery backed rtc's
This seems to be what chrony -s is doing. And setting that can be an option on the install for 'no rtc battery'.
I seem to have gotten this to work on F22. But I am not getting it to work on my Centos7-arm image. But that is a thread for their list :)
On Wed, 2 Sep 2015, Dennis Gilmore wrote:
I would really like to know the use cases where chronyd is not sufficient and the problems that people are trying to solve.
Don't the reasons include ( as in a IoT unit with only occasional external network access to a timesource ): 1. avoidance of unnecessary FSCK's due to 'elapsed time since last check'
2. permitting cacheing, and then cache expiration of potential reliable nameserver information (needed to 'boot-strap' into reaching a timeserver array)
-- Russ herrold
ps: hi, Dennis -- long time, no see
On 09/02/2015 10:51 AM, R P Herrold wrote:
On Wed, 2 Sep 2015, Dennis Gilmore wrote:
I would really like to know the use cases where chronyd is not sufficient and the problems that people are trying to solve.
Don't the reasons include ( as in a IoT unit with only occasional external network access to a timesource ):
- avoidance of unnecessary FSCK's due to 'elapsed
time since last check'
Why I change my fstab to disable this!
- permitting cacheing, and then cache expiration of
potential reliable nameserver information (needed to 'boot-strap' into reaching a timeserver array)
-- Russ herrold
ps: hi, Dennis -- long time, no see _______________________________________________ arm mailing list arm@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/arm
On 09/02/2015 10:29 AM, Dennis Gilmore wrote:
On Wednesday, September 02, 2015 03:46:55 PM Miroslav Lichvar wrote:
On Wed, Sep 02, 2015 at 08:51:17AM -0400, Robert Moskowitz wrote:
OH?!? I am running F22 with Xfce, last updated Aug 23. So whatever is in there wrt systemd-timesyscd and chronyd is what was in the image orginally plus whatever happened when I did the date/time config in the graphic configurator as part of the install (I go in and change my city from NYC to Detroit). A quick check shows:
So it seems both are present, but only chronyd is running.
The chrony package is installed by default and the time configuration tool is enabling/disabling the chronyd service (via timedatex). To start timesyncd on boot you can either run "systemctl disable chronyd" and "systemctl enable timesyncd", or uninstall the chrony and timedatex packages and disable and enable the NTP checkbox again in the time config.
I made these changes. In /etc/chrony.conf I now have:
# Enable kernel synchronization of the real-time clock (RTC). #rtcsync rtcdevice /dev/nonexist
I commented out the rtcsync line, given you told me to add the nonexist line. Hope that is correct.
That shouldn't matter, if there is no battery for the RTC, there is probably no point in trying to keep the RTC synchronized.
Perhaps these settings should be standard in our armv7 builds? Or an easy option to set them. A check box for 'no rtc' on that configurator?
Maybe anaconda could do that. How common is to have a Fedora ARM machine without an RTC and how common it is to have an RTC, but no battery?
Every arm device I have used has a rtc, but a very large number of them have no battery. some have two rtc devices and teh battery backed one ends up on /dev/rtc1
Using timedatectl to check things, I noticed:
# timedatectl Local time: Wed 2015-09-02 14:05:18 UTC Universal time: Wed 2015-09-02 14:05:18 UTC RTC time: Thu 1970-01-01 00:20:40 Timezone: n/a (UTC, +0000) NTP enabled: yes NTP synchronized: yes RTC in local TZ: no DST active: n/a
but even with rtcsync enabled, the RTC time is always running at epoch start time. So perhaps there is an rtc, with no battery. But it is not getting synced from the system by chrony.
For some reason, SoC makes consider the space for a battery as too expensive.
There is also a possibility to restore the time from a file in a separate service, without having to run an NTP client. On Debian, it's done by the fake-hwclock service. For Fedora there seems to be a Copr repo with it. I didn't try it.
chronyd in my use has always set the time correctly as soon as it has a working network connection.
Right. Once connected. And if connection is not there at start, but comes up later (you forgot to turn on the ethernet switch), it takes perhaps 5min after ip is enabled until the time is corrected.
any attempt to set the time based on something in the filesystem is going to result in the time being off. if it is something baked in at compose or image creation time the drift will get bigger over time. if it is some service that sets it on shutdown the drift will be small. network is required to get it accurate.
True, but I can come up with lots of cases of no internet and needing some sense of time.
I would really like to know the use cases where chronyd is not sufficient and the problems that people are trying to solve.
Consider your system controls your house security. External power and internet are off due to a storm, but you have internal power (like that Telsa wall battery). For some reason your system rebooted and now it comes up with date of 1-1-1970. Not so good.
Your system is in your car. It powers up when the car is started. Internet access is only available when it is in your garage or your phone has internet. You are on vacation in the woods, no internet on your phone. No accurate or even approximate time on your system? Not so good.
Yes, these are edge cases. But they will occur and we need to handle them properly. rtc batteries are currently rare on arm boards, it seems. It appears there are tools that mostly work; they should be enabled.
On Tue, Sep 01, 2015 at 01:38:21PM -0500, Dennis Gilmore wrote:
Without a battery backed RTC its really not that useful. Picture 6 or 10 months after a release, does it matter if the time is half a year to a year off or 35 years off?
If a system needs to use something TLS-protected, then the system clock must not be too much off because a certificate might not be valid otherwise. At least in debian there is also a fake hwclock package that reduces the offset to the time that passed since the system was last booted:
https://packages.debian.org/sid/fake-hwclock
Regards Till
On Wednesday, September 02, 2015 04:45:33 PM Till Maas wrote:
On Tue, Sep 01, 2015 at 01:38:21PM -0500, Dennis Gilmore wrote:
Without a battery backed RTC its really not that useful. Picture 6 or 10 months after a release, does it matter if the time is half a year to a year off or 35 years off?
If a system needs to use something TLS-protected, then the system clock must not be too much off because a certificate might not be valid otherwise. At least in debian there is also a fake hwclock package that reduces the offset to the time that passed since the system was last booted:
Sure, but is there uses for TLS without the network having come up? at which point chronyd would have set the time correctly.
Dennis
On 09/02/2015 11:18 AM, Dennis Gilmore wrote:
On Wednesday, September 02, 2015 04:45:33 PM Till Maas wrote:
On Tue, Sep 01, 2015 at 01:38:21PM -0500, Dennis Gilmore wrote:
Without a battery backed RTC its really not that useful. Picture 6 or 10 months after a release, does it matter if the time is half a year to a year off or 35 years off?
If a system needs to use something TLS-protected, then the system clock must not be too much off because a certificate might not be valid otherwise. At least in debian there is also a fake hwclock package that reduces the offset to the time that passed since the system was last booted:
Sure, but is there uses for TLS without the network having come up? at which point chronyd would have set the time correctly.
I do a lot of work in IoT, much of it Zigbee or Zwave. But would also like to get into Bacnet.
We push real hard on secure communications within the home. So as I said, the home controller is the web server with the cert and it is on UPS and survived the power flux and still has the correct time. The furnace controller went off line until it was restarted on the switch to the backup home generator. Now the furnace controller has bad time in connecting to the home controller over TLS.
i can go on and on. Yes these are all edge cases, but you have to design for them.
On 09/02/2015 10:45 AM, Till Maas wrote:
On Tue, Sep 01, 2015 at 01:38:21PM -0500, Dennis Gilmore wrote:
Without a battery backed RTC its really not that useful. Picture 6 or 10 months after a release, does it matter if the time is half a year to a year off or 35 years off?
If a system needs to use something TLS-protected, then the system clock must not be too much off because a certificate might not be valid otherwise. At least in debian there is also a fake hwclock package that reduces the offset to the time that passed since the system was last booted:
This could occur in a home where the device is accessing the home server and the home is off the net since before the device restarted. A slew of a few hours, perhaps even a day should not be a stopper, unlike day 0.
On 09/01/2015 12:14 PM, Robert Nelson wrote:
On Tue, Sep 1, 2015 at 11:10 AM, Robert Moskowitz rgm@htt-consult.com wrote:
How is system time set? Is ntpdate run after the network is ready? How long does it retry waiting for the network to be available?
I have seen a number of challenges becuase the system time is bac at the epoch start as there is no battery rtc. And I wonder how many armv7 boards have a battery to maintain time across boots?
Minimally, a process could right the time, in the proper format, to a file, say /etc/currenttime every 5 min and at shutdown.
Then date can be run early in the boot process, piping this file in. It would not be perfect and does not help, much for new installs, but better than epoch start.
Plus /etc/currenttime can be at least set to the image build date/time so not even firstboot will be at epoch start.
systemd v215+ has a nice feature to take care of this:
systemctl enable systemd-timesyncd.service
What rpm provides this? I am not finding it...
On Tue, Sep 1, 2015 at 12:27 PM, Robert Moskowitz rgm@htt-consult.com wrote:
On 09/01/2015 12:14 PM, Robert Nelson wrote:
On Tue, Sep 1, 2015 at 11:10 AM, Robert Moskowitz rgm@htt-consult.com wrote:
How is system time set? Is ntpdate run after the network is ready? How long does it retry waiting for the network to be available?
I have seen a number of challenges becuase the system time is bac at the epoch start as there is no battery rtc. And I wonder how many armv7 boards have a battery to maintain time across boots?
Minimally, a process could right the time, in the proper format, to a file, say /etc/currenttime every 5 min and at shutdown.
Then date can be run early in the boot process, piping this file in. It would not be perfect and does not help, much for new installs, but better than epoch start.
Plus /etc/currenttime can be at least set to the image build date/time so not even firstboot will be at epoch start.
systemd v215+ has a nice feature to take care of this:
systemctl enable systemd-timesyncd.service
What rpm provides this? I am not finding it...
Should be a default part of systemd..
Regards,
On 09/01/2015 01:31 PM, Robert Nelson wrote:
On Tue, Sep 1, 2015 at 12:27 PM, Robert Moskowitz rgm@htt-consult.com wrote:
On 09/01/2015 12:14 PM, Robert Nelson wrote:
On Tue, Sep 1, 2015 at 11:10 AM, Robert Moskowitz rgm@htt-consult.com wrote:
How is system time set? Is ntpdate run after the network is ready? How long does it retry waiting for the network to be available?
I have seen a number of challenges becuase the system time is bac at the epoch start as there is no battery rtc. And I wonder how many armv7 boards have a battery to maintain time across boots?
Minimally, a process could right the time, in the proper format, to a file, say /etc/currenttime every 5 min and at shutdown.
Then date can be run early in the boot process, piping this file in. It would not be perfect and does not help, much for new installs, but better than epoch start.
Plus /etc/currenttime can be at least set to the image build date/time so not even firstboot will be at epoch start.
systemd v215+ has a nice feature to take care of this:
systemctl enable systemd-timesyncd.service
What rpm provides this? I am not finding it...
Should be a default part of systemd..
So I see from https://wiki.archlinux.org/index.php/Systemd-timesyncd
If I would have read just a little further down the page there is:
timedatectl set-ntp true
But I don't see how to get this right for firstboot?
On 9/1/15 12:10 PM, Robert Moskowitz wrote:
How is system time set? Is ntpdate run after the network is ready? How long does it retry waiting for the network to be available?
Recent Fedora versions have switched from ntp to chronyd. chronyd is built for the laptop/tablet era where networks can come and go, and will slam in a time as soon as it sees a network instead of waiting for the clock to get stable.
I have seen a number of challenges becuase the system time is bac at the epoch start as there is no battery rtc. And I wonder how many armv7 boards have a battery to maintain time across boots?
I bought a battery for my board, and yes this is a problem for ARM boards, but I've also seen this issue on old Intel systems where the BIOS battery has died.
-Scott
On 09/01/2015 12:18 PM, Scott M. Jones wrote:
On 9/1/15 12:10 PM, Robert Moskowitz wrote:
How is system time set? Is ntpdate run after the network is ready? How long does it retry waiting for the network to be available?
Recent Fedora versions have switched from ntp to chronyd. chronyd is built for the laptop/tablet era where networks can come and go, and will slam in a time as soon as it sees a network instead of waiting for the clock to get stable.
Ah, that is how it is done in Fedora. I wondered that.
But that still does not help when the network is not available.
I have seen a number of challenges becuase the system time is bac at the epoch start as there is no battery rtc. And I wonder how many armv7 boards have a battery to maintain time across boots?
I bought a battery for my board, and yes this is a problem for ARM boards, but I've also seen this issue on old Intel systems where the BIOS battery has died.
-Scott
On Tue, 1 Sep 2015, Robert Moskowitz wrote:
Minimally, a process could right the time, in the proper format, to a file, say /etc/currenttime every 5 min and at shutdown.
You may wish to 'prime the pump' with something like: uname -a | cut -d" " -f 6-11
which is readily available, first, to 'get close'
-- Russ herrold