Bug 753642
Summary: | Strange RTC/UTC time manipulations at boot, seen symptom is first-born DHCP IP address sacrificed | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Thomas L. Shinnick <tshinnic> |
Component: | systemd | Assignee: | systemd-maint |
Status: | CLOSED DUPLICATE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | rawhide | CC: | fullung, johannbg, lnykryn, metherid, mlichvar, mmaslano, msekleta, notting, nphilipp, plautrba, stephent98, systemd-maint, vpavlin |
Target Milestone: | --- | Keywords: | FutureFeature |
Target Release: | --- | ||
Hardware: | All | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Enhancement | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2013-01-14 22:14:06 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Thomas L. Shinnick
2011-11-13 22:45:01 UTC
This looks like system-config-date didn't call hwclock --systohc after the installation, possibly because NTP wasn't synced yet. Can you please verify that calling "hwclock --systohc" manually fixes the problem? In F15 and before it used to be called on shutdown, but it's not now and it needs to be called whenever the offset between the local and UTC time changes, see bug #750883. Thank you for the suggested test. It does change the situation to the desired bahavior. The change where someone dropped the setting of RTC at shutdown time is apparently the source of my problem. And it *is* a problem. Drastic 6 hour changes in clock time during boot processing certainly massively confuses components needing/comparing timestamps during boot. Installed a new F16 selecting timezone Chicago (CST). On first boot, Nov 14 04:46:25 tls16d kernel: imklog 5.8.5, log source = /proc/kmsg started. Nov 14 04:46:25 tls16d rsyslogd: [origin software="rsyslogd" swVersion="5.8.5" x-pid="719" x-info="http://www.rsyslog.com"] sta received new DHCP lease .169 start out as 04:52, jumps to 10:52 Nov 14 04:52:24 tls16d chronyd[955]: chronyd version 1.26-20110831gitb088b7 starting Nov 14 04:52:24 tls16d chronyd[955]: Linux kernel major=3 minor=1 patch=1 Nov 14 04:52:24 tls16d chronyd[955]: hz=100 shift_hz=7 freq_scale=1.00000000 nominal_tick=10000 slew_delta_tick=833 max_tick_bi Nov 14 04:52:30 tls16d chronyd[955]: Selected source 67.228.223.170 Nov 14 04:52:30 tls16d chronyd[955]: System clock wrong by 21600.682082 seconds, adjustment started Nov 14 10:52:31 tls16d chronyd[955]: System clock was stepped by 21600.682 seconds still .169 after 12 minutes changes to .170 after 14 minutes sudo hwclock --show Mon 14 Nov 2011 05:03:14 AM CST -1.047933 seconds >>> sudo hwclock --systohc date Mon Nov 14 11:03:50 CST 2011 sudo hwclock --show Mon 14 Nov 2011 11:03:58 AM CST -1.044210 seconds this is the correct current localtime restarted On second boot Nov 14 11:07:08 tls16d kernel: imklog 5.8.5, log source = /proc/kmsg started. Nov 14 11:07:08 tls16d rsyslogd: [origin software="rsyslogd" swVersion="5.8.5" x-pid="716" x-info="http://www.rsyslog.com"] sta keeps previous DHCP lease of .170 Nov 14 11:07:23 tls16d chronyd[747]: Selected source 208.94.240.2 Nov 14 11:07:23 tls16d chronyd[747]: System clock wrong by -0.739594 seconds, adjustment started date Mon Nov 14 11:08:10 CST 2011 sudo hwclock --show Mon 14 Nov 2011 11:08:22 AM CST -1.046785 seconds this is the correct localtime no sudden jumps later no throwing away DHCP leases (bliss) Again, the selections I made during installation were selecting timezone Chicago and defaulting to "System clock uses UTC" when install moves the second phase, I select "Synchronize date and time over the network" defaulting to the x.fedora.pool.ntp.org domain names If there is nothing wrong with me making those selections, then there is something wrong with the installation, as the RTC is left unset, and my problems with DHCP and the other problems noted by other people then occur after reboots. I can't speak to the many scenarios cited in those other bug reports, such as dual-boots and time zone daylight/standard changes. This is a much simpler case, I think, but which is not handled correctly. To some extent, this has been caused by systemd dropping hwclock-save.service as described here: http://lists.freedesktop.org/archives/systemd-devel/2011-May/002526.html If this had still been in place, the problems described here would at least disappear with a reboot. But that does start us down a slippery slope... (In reply to comment #3) > To some extent, this has been caused by systemd dropping > hwclock-save.service as described here: > > http://lists.freedesktop.org/archives/systemd-devel/2011-May/002526.html > > If this had still been in place, the problems described here would at least > disappear with a reboot. But that does start us down a slippery slope... Bug 816752, Comment 50 proposes adding an hwclock.service: Bug 816752 - systemd v28 changes indirectly break date and ntpdate hwclock reads /etc/adjtime, so what this does is ambiguous without knowing what is in /etc/adjtime: # hwclock --systohc The --noadjfile option disables reading /etc/adjtime: # hwclock --systohc --noadjfile ---utc # hwclock --systohc --noadjfile --localtime The RTC can be read with: $ cat /proc/driver/rtc This doesn't seem to be an issue with system-config-date (it calls hwclock), right? I'll change the component to systemd on account of that this needs to be dealt with at one place or another and systemd seems to be it right now (cf. comment #3, comment #4). So when does the RTC get _initialized_ then? (In reply to comment #6) > This doesn't seem to be an issue with system-config-date (it calls hwclock), > right? I'll change the component to systemd on account of that this needs to > be dealt with at one place or another and systemd seems to be it right now > (cf. comment #3, comment #4). Perhaps it would be best to stay in sync with Bug #816752 , which is currently set to "Component: distribution" after my hissy fit there. Is there a way to link this report to 816752, as that one seems to be productive, addresses the same problem, and sorta supersedes this report? You can close this bug as a duplicate of Bug 816752, but I'm not sure that this is indeed a duplicate. I haven't been able to reproduce the problems you are reporting with F16 in a VM with the VM RTC set to UTC or local time. Here is what I already had written up: (In reply to comment #0) ... > Running under VMware Workstation 6.5 with Windows host. (Hmm, ... Do you have your VM configured to start with the RTC set to UTC or local time? With qemu, there is an option to set the RTC at startup: -rtc base=localtime Also, what hwclock shows depends on what is in /etc/adjtime. This shows the RTC without any time zone offsets to confuse matters: $ cat /proc/driver/rtc BTW, what "System clock uses UTC" configures is the time zone of the RTC. That is recorded in /etc/adjtime as "UTC" or "LOCAL". The wording in system-config-date is wrong. The system clock is not the same as the RTC (aka hwclock). See "man adjtimex". Last, in F18 there are problems when the RTC is on local time: Bug 870535 - Regression in handling of localtime RTC: timezone offset applied twice (This appears to be fixed with systemd-195-10.fc18.) Bug 881403 - Anaconda doesn't correctly infer if system clock shows UTC or local time *** This bug has been marked as a duplicate of bug 816752 *** |