Quote:
|
Quote:
So, I'll give you the cheap hack here. What activates this kernel feature is starting ntpd. So, if your hardware clock is not using UTC, add a line to the start section of rc.ntpd so that after ntpd is started, the system clock is saved to the hardware clock: hwclock --localtime --systohc After that the kernel won't mess with the hardware clock again. |
Quote:
Here is what I did. I simply copy the entry from rc.0/rc.6 to rc.ntpd to update the hardware clock only if it set to 'localtime'. Code:
# The kernel is now mocking around with the the hardware clock (wall clock) if |
Quote:
|
I updated my earlier post for clarity. I updated the start section of rc.ntpd as suggested by adding hwclock update from rc.0/rc.6, with minor tweaks.
|
Patch...
1 Attachment(s)
rc.ntpd.patch
|
While we're on the subject of the system clock, I believe the clock setting code in rc.S can be simplified significantly with modern kernels and util-linux. The following seems to be all that is needed:
Code:
# Time-warp the system clock to correct for a CMOS/Hardware Clock From what I've read this is particularly desirable to those who run VM instances as hwclock --hctosys calls can be slow in a VM (or so I've read). Anyway, seems to work for me, but someone with a slightly greater offset from UTC might want to give it a test. |
Quote:
|
After leaving this for a few days, it seem running hwclock does not disable to 11 minute mode. The only way I found to turn this off was to shut down NTP. IMO, disabling NTP is not an option. I have since removed the rc.ntp patch.
|
tux_dude the patch I provided earlier for the kernel does remove the offending code and fixes the problem properly.
This is the way I'm now running and will continue to do so. |
Do we have a better feel for this yet? In testing my experience was the same as tux_dude: that the rc.ntpd change has had no effect on 11 minute mode. If this code is indeed not making any difference then it's probably best to revert it and strip out some unneeded complexity in the rc.ntpd file.
If the new code is indeed working for some people, then may I suggest a minor reordering for the sake of efficiency in the case that the hardware clock is running UTC. Code:
--- rc.ntpd.orig 2013-10-22 13:15:07.026378761 +0100 |
I've conceded, switched my hardware clock on systems not on UPS to UTC.
|
How to force cmos clock to LOCALTIME - at least for me it worked.
I know this is an old thread, however it took me 3 years (yes, YEARS) to finally find the solution. In my case, Mint 18.2. I'm hoping that if someone needs this in the future, they'll find this and it will save them a lot of time...
Short version: Make sure /etc/adjtime has 'LOCAL' and not 'UTC' (in my case, it was the last line of the file). Make sure /etc/hardwareclock has 'localtime' in it (in my case, this was a new file and only had that line in it). Doing the above seems to have turned off the 'NTP synch' flag in the kernel, which keeps the kernel from writing the UTC time into the CMOS clock upon shutdown. So it is highly likely that the kernel won't save the system time in the CMOS clock (I've not verified this). However, the above 2 changes appear to have turned off '11-minute mode'. Here's the output of 'timedatectl': rusty@quigon2 ~ $ timedatectl(Note the 'NTP synchronized' info in red above). Make sure you have some way to get time synch from NTP (in my case, every 30 minutes I run rdate (as root, with the slew mode and not the 'jump' mode)). Make sure you have something setting the CMOS clock to the correct time (again, in my case that 30 minute cron job also runs 'hwclock --systohc') As I say, I've not verified that I need that cron job yet, you may find out that I've overkilled it badly.... Keywords: 11-minute mode, UTC, localtime, CMOS |
All times are GMT -5. The time now is 07:04 AM. |