Mageia Setting Hardware Clock to same as Local Time via NTP

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

Mageia Setting Hardware Clock to same as Local Time via NTP

Postby KnightMB » Mar 29th, '16, 17:41

I've searched around the Internet and forums. I don't know if anyone has encountered this or had the issue solved, but it seems to appear on both 32bit and 64bit systems (Mageia 5) when testing. When using the MCC to manage date and time, one of the options you have is the ability to set the hardware clock to UTC when the "Is your hardware clock set to GMT?" question comes up. It works fine for the first time, you can run "hwclock" in the CLI and confirm it is set properly. But after a reboot or any other time when NTP does a clock update, it sets the hardware clock to be the same as local time. This unfortunately messes with programs that depend on UTC time (like Kontact for example)

If you use a watch command like "watch hwclock" you can see where it gets set right temporarily for a minute, then switches back to local time again.

The only way I've seen to fix this is go in MCC and when saving your clock/timezone info, when it ask "Is your hardware clock set to GMT?" select "No" and it will fix the hardware clock time properly. If you click "ok" to save out, it runs another NTP update and switches the hardware clock back to local time. On the flip side, if the hardware clock is set wrong, doing the same thing (MCC) and selecting "Yes" to the GMT question will also fix the hardware clock until either you click "OK" to save (which causes an NTP update where the time is set wrong again).

It seems as though NTP is what is setting the hardware clock wrong, even though it should be doing time updates in UTC, I can't figure out how to fix that part.
User avatar
KnightMB
 
Posts: 76
Joined: Nov 21st, '12, 21:27

Re: Mageia Setting Hardware Clock to same as Local Time via

Postby gohlip » Mar 29th, '16, 18:29

If you're using windows, windows uses local time instead of utc.
So clock switches every time you switch OS's.
Best to set windows to utc instead of local time (some recommend switching linux to local time because it's easier to do so but it is not good to use local time for any system).
https://www.cl.cam.ac.uk/~mgk25/mswish/ut-rtc.html

To set time, I personally prefer using timedatectl. For example...
Code: Select all
$ timedatectl list-timezones
# timedatectl set-timezone America/Lima
# timedatectl set-ntp true
# timedatectl set-local-rtc false
# hwclock --systohc --utc


To change windows to utc,
http://crashmag.net/configuring-windows ... -bios-time
Why do we live? To prove not everything in nature has a purpose.
gohlip
 
Posts: 573
Joined: Jul 9th, '12, 10:50

Re: Mageia Setting Hardware Clock to same as Local Time via

Postby KnightMB » Mar 29th, '16, 21:20

Mageia runs the whole system, no sharing with windows or any other OS.

I've give those commands a try and see if they solve the issue, thanks!
User avatar
KnightMB
 
Posts: 76
Joined: Nov 21st, '12, 21:27

Re: Mageia Setting Hardware Clock to same as Local Time via

Postby KnightMB » Mar 30th, '16, 03:41

It seems something is still over-riding the hardware clock with local time even when it is suppose to be set for GMT time, so this might not be fixable in the current version of Mageia 5. I will need to file a bug report as it appears there is a rather odd way to make it save the proper way of time setting. :?:
The only way that seems to work is use the MCC to set a timezone, answer no to the GMT questions (shouldn't it be yes) and then kill the MCC app so that it sticks with the GMT clock mode instead of resetting back to local time when saving.
User avatar
KnightMB
 
Posts: 76
Joined: Nov 21st, '12, 21:27

Re: Mageia Setting Hardware Clock to same as Local Time via

Postby KnightMB » Mar 30th, '16, 04:01

I was thinking, before I do a bug report, maybe I am wrong about how this is suppose to work or be set.

I thought that first, starting in MCC, I go to System, then Manage Date and Time.

I pick a timezone (America/Chicago) and then I get a message "Is your hardware clock set to GMT?" with a No or Yes response. I am thinking that it is asking if I want my hardware clock set to GMT, so I select "Yes" to the question. I click OK to save and it does a quick NTP check and updates my clock. In the lower right hand of my screen, I can see it has the correct time, all the way down to the second set properly.

If I run hwclock at the CLI, it shows that my hardware clock is set exactly like my local time clock. I thought the logic was that telling it to set my hardware clock to GMT that the hardware clock would show a time/date well ahead of my local time. Instead, it is just a mirror copy of my local time.

Am I confusing how the Manage Date and Time MMC component is suppose to function?
User avatar
KnightMB
 
Posts: 76
Joined: Nov 21st, '12, 21:27

Re: Mageia Setting Hardware Clock to same as Local Time via

Postby gohlip » Mar 30th, '16, 05:40

KnightMB wrote:If I run hwclock at the CLI, it shows that my hardware clock is set exactly like my local time clock.

i think that's the problem (if all else is set properly).
This command
Code: Select all
# hwclock --systohc --utc
will set your hardware clock to utc but make sure time displayed (at the panel) is at correct time first.
Why do we live? To prove not everything in nature has a purpose.
gohlip
 
Posts: 573
Joined: Jul 9th, '12, 10:50


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest

cron