SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
One of the recent kernels introduced these new options, which sound as if they may be relevant.
CONFIG_RTC_HCTOSYS:
If you say yes here, the system time (wall clock) will be set using the value read from a specified RTC device. This is useful to avoid unnecessary fsck runs at boot time, and to network better.
CONFIG_RTC_SYSTOHC:
If you say yes here, the system time (wall clock) will be stored in the RTC specified by RTC_HCTOSYS_DEVICE approximately every 11 minutes if userspace reports synchronized NTP status.
Also check out the help text on CONFIG_RTC_HCTOSYS_DEVICE: This device should record time in UTC, since the kernel won't do timezone correction
If you're running your hw_clock on localtime then you probably want to avoid these new RTC options in your kernel config (especially the second one).
P.S. Both appear to be set to Y in config-generic-3.10.12.x64
This is interesting. If I read it correctly, it looks like I'm probably being affected by CONFIG_RTC_SYSTOHC, since this cause the RTC (BIOS) clock to be updated every 11 minutes.
I couldn't find any option to disable this feature without recompiling the kernel. I am not a fan of building my own kernel as it is too much maintenance work for me. What are other who are not affected doing?
This is interesting. If I read it correctly, it looks like I'm probably being affected by CONFIG_RTC_SYSTOHC, since this cause the RTC (BIOS) clock to be updated every 11 minutes.
I couldn't find any option to disable this feature without recompiling the kernel. I am not a fan of building my own kernel as it is too much maintenance work for me. What are other who are not affected doing?
Well, I'm assuming that GazL has nit the nail on the head as usual, and will remove those options from the 3.10.14 kernels. Test 'em when they go up... shouldn't be long.
I hope that does fix it Pat as I just got hit by this little kernel addition and if you also run your own DNS as I do dnssec will fall in a heap and it is pretty much a requirement these days.
I'd encourage folks to run their hw clock on UTC if at all possible and only use 'localtime' if absolutely necessary. It's clearly the way the system is intended to be used and avoids these sorts of issues.
If you dual-boot with Windows there's a registry entry you can change to make it also treat the hardware clock as UTC which is what I've done here.
CONFIG_RTC_SYSTOHC:
If you say yes here, the system time (wall clock) will be stored in the RTC specified by RTC_HCTOSYS_DEVICE approximately every 11 minutes if userspace reports synchronized NTP status.
I am going to point the finger at this setting. On my system that dual boots to Windows, I have the hardware clock set to local time, but I do not use NTP (I let Windows do the time synchronisation). I have not seen this issue.
I wouldn't call it necessary, however I would rather have my hardware clock set to localtime. Since the kernel does not do localtime, then this option should read:
Quote:
CONFIG_RTC_SYSTOHC:
If you say yes here, the system time (wall clock) will be stored in the RTC specified by RTC_HCTOSYS_DEVICE approximately every 11 minutes if the system time (wall clock) is set to UTC and the userspace reports synchronized NTP status.
Running the new kernel and the new options are right :-
Code:
root@indigo:/proc# zcat config.gz | grep RTC
CONFIG_HPET_EMULATE_RTC=y
CONFIG_RTC_LIB=y
CONFIG_RTC_CLASS=y
# CONFIG_RTC_HCTOSYS is not set
# CONFIG_RTC_SYSTOHC is not set
But it still happens :-
Code:
Fri Oct 4 21:46:34 EST 2013
Fri 04 Oct 2013 21:46:35 EST -0.986628 seconds
Fri Oct 4 21:47:35 EST 2013
Fri 04 Oct 2013 21:47:36 EST -1.001941 seconds
Fri Oct 4 21:48:36 EST 2013
Fri 04 Oct 2013 11:48:37 EST -0.955072 seconds
Fri Oct 4 21:49:37 EST 2013
Fri 04 Oct 2013 11:49:38 EST -1.001944 seconds
Distribution: slack 7.1 till latest and -current, LFS
Posts: 368
Rep:
Hi All,
grabbed this part from arch linux
Recent kernels set the system time from the RTC directly on boot, assuming that the RTC is in UTC. This means that if the RTC is in local time, then the system time will first be set up wrongly and then corrected shortly afterwards on every boot. This is the root of certain weird bugs (time going backwards is rarely a good thing).
These will generate /etc/adjtime automatically; no further configuration is required.
During kernel startup, at the point when the RTC driver is loaded, the system clock may be set from the hardware clock. Whether this occurs or not depends on the hardware platform, the version of the kernel and kernel build options. If this does occur, at this point in the boot sequence, the hardware clock time is assumed to be UTC and the value of /sys/class/rtc/rtcN/hctosys (N=0,1,2,..) will be set to 1. Later, the system clock is set again from the hardware clock from systemd/udev, dependent on values in /etc/adjtime. Hence, having the hardware clock using localtime may cause some unexpected behavior during the boot sequence; e.g system time going backwards, which is always a bad idea.
so indeed the option of wildwizard is the other option that needs to be killed
Last edited by bartgymnast; 10-04-2013 at 07:50 AM.
Automatic Hardware Clock Synchronization By the Kernel
You should be aware of another way that the Hardware Clock is kept synchronized in some systems. The Linux kernel has a mode
wherein it copies the System Time to the Hardware Clock every 11 minutes. This is a good mode to use when you are using
something sophisticated like ntp to keep your System Time synchronized. (ntp is a way to keep your System Time synchronized
either to a time server somewhere on the network or to a radio clock hooked up to your system. See RFC 1305).
This mode (we'll call it "11 minute mode") is off until something turns it on. The ntp daemon xntpd is one thing that turns
it on. You can turn it off by running anything, including hwclock --hctosys, that sets the System Time the old fashioned
way.
To see if it is on or off, use the command adjtimex --print and look at the value of "status". If the "64" bit of this num-
ber (expressed in binary) equal to 0, 11 minute mode is on. Otherwise, it is off.
If your system runs with 11 minute mode on, don't use hwclock --adjust or hwclock --hctosys. You'll just make a mess. It is
acceptable to use a hwclock --hctosys at startup time to get a reasonable System Time until your system is able to set the
System Time from the external source and start 11 minute mode.
Is something going on that is turning "11 minute mode" off?
I have been looking at /usr/src/linux/kernel/time/ntp.c
As I read it, if you turn off both CONFIG_GENERIC_CMOS_UPDATE and CONFIG_RTC_SYSTOHC, then the "11 minute mode" will be entirely turned off.
Yep it looks like the new RTC stuff is only part of the story and there's a second mechanism at play here.
Here's some background info I stumbled upon: https://lkml.org/lkml/2013/4/23/690
The interesting thing is that ntp.c contains this:
... which looks like it should still deal with a clock in localtime assuming persistent_clock_is_local and sys_tz are being set correctly.
This whole area looks like a big mess. Maybe the latest util-linux might help?, but to be honest I'm inclined to go back to my previous suggestion which echoes one of the comments in kernel/time.c:
Code:
*The best thing to do is to keep the CMOS clock in universal time (UTC)
* as real UNIX machines always do it. This avoids all headaches about
* daylight saving times and warping kernel clocks.
*/
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.