Problems with automatic time synchronisation

Hello,

  • _OpenMandriva Lx version: 3.03

  • _Desktop environment (KDE, LXQT…): KDE

  • Description of the issue (screenshots if relevant):
    I have a dual boot laptop (Windows 7, OpenMandrivaLx3.03).
    When I boot Windows 7 the time is set right.
    When I afterwards boot OpenMandrivaLx3.03 two hours are added to the correct time and this wrong time isn’t corrected. Therefore I think automatic time synchronisation isn’t working.
    I executed the timedatectl command see below:

$ timedatectl
Local time: ma 2018-08-20 18:04:25 CEST
Universal time: ma 2018-08-20 16:04:25 UTC
RTC time: ma 2018-08-20 16:04:25
Time zone: Europe/Brussels (CEST, +0200)
System clock synchronized: no
systemd-timesyncd.service active: no
RTC in local TZ: no
$

The Local time is what I get in the KDE toolbar clock. This time is 2 houres later than the real time.

Any idea how to fix this?

Regards,
Albert

https://forum3.openmandriva.org/t/resolu-reglage-de-lheure/480

https://forum3.openmandriva.org/t/orario-errato-due-ore-in-anticipo/1901

Different languages but easy to understand, also with the help of online translator if needed.

In all Linux systems that dual or multi boot with Windows you need to set ‘RTC in local TZ:’ to yes. And reboot.

1 Like

Hello,

My French is very bad and my Italian is non existing but I believe that the general idea of the previous replies is:
When you are booted in the Windows environment and shut the system down, the system time is save in a certain way. When you then boot OpenMandrivaLx this saved time is loaded and interpreted in the Linux way to have a starting point for the system time.
Because the interpretation of the saved time differs between Windows and Linux, Linux will show the wrong time.
Right so far?

Now I can live with that difference as a starting point, but after some time the Linux Network Time Protocol synchronization should kick-in, adjusting the system time and display the correct time in the KDE toolbar.
Right?

Well that time synchronization doesn’t happen on my dual boot system when in the Linux environment but it happens when in the Windows environment. That brings me to the question: how can I check that Network Time Protocol synchronization is setup correctly?

Regards,
Albert

Today we will be working from the command line. You do not need to become root in Konsole to do this stay as user ($). You will be asked for root (administrator) password for some of these actions.

Your information shows that your time synchronization is off:

System clock synchronized: no
systemd-timesyncd.service active: no

Your information shows that Hardware clock or RTC are set to UTC (not local tz):

RTC in local TZ: no

You can also check

$ timedatctl --help

$ man timedatectl

If you wish to understand better. Also explained here.

First is to realize that computers have two clocks a system clock (what KDE shows on desktop) and a hardware or Real Time Clock (RTC). It is the HW or Hardware (RTC) clock that controls everything including system time. If you you’re dual booting with windows
you need to have HW clock aka RTC set to local tz because that is what Windows does. To change that:

$ timedatectl set-local-rtc 1 --adjust-system-clock

Another way to check if synchronization is working (this shows what yours probably looks like now):

$ systemctl status systemd-timesyncd.service
● systemd-timesyncd.service - Network Time Synchronization
   Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Tue 2018-08-21 13:29:20 CDT; 3min 10s ago
     Docs: man:systemd-timesyncd.service(8)
  Process: 3270 ExecStart=/lib/systemd/systemd-timesyncd (code=exited, status=0/SUCCESS)
 Main PID: 3270 (code=exited, status=0/SUCCESS)
   Status: "Idle."

This shows the service as inactive (dead). Note: ‘vendor preset: enabled’ So something turned this off at some point. We’ll probably never know what did that.

First lets change Hardware clock or HW clock (also RTC) to local tz:

$ timedatectl set-local-rtc 1 --adjust-system-clock

Now lets turn on and re-enable ‘systemd-timesyncd.service’:

$ sudo systemctl start systemd-timesyncd.service

press ‘q’ to quit then do:

$ sudo systemctl enable systemd-timesyncd.service

Now results of these actions in next post.

Dadgummit!

:monkey_face:

Hello Ben,

Sorry that I worked on your nerves but swearing isn’t needed, by the way it’s god-damn-it not Dadgummit and thanks for the emoticon.

Regards,
Albert

1 Like

Dadgummit is considered a humorous way of being emphatic here. Plus that is meant in humor. Not frustration or anger at all nor meant in spirit of swearing. And this is a reminder (Post-edit: reminder to me that is) that some things don’t work well on an international forum.

Edit: And you aren’t working on my nerves one bit. So everyone relax.

What stopped me was I’ve run in to something that is an OpenMandriva issue and am getting different answers from different developers. Now that can get frustrating but isn’t so far.

But any way my attempt at a how to was interrupted due to technical disagreements behind the scenes. But what I posted should correct time issue for anyone Dual booting Windows and OMLx 3. The issue there is that in Linux you have to have:

RTC in local TZ: yes

On your Linux system or on all Linux systems if you multi-boot.

OK, the results of what we did above are shown:

    $ timedatectl
                      Local time: Tue 2018-08-21 10:22:47 CDT
                  Universal time: Tue 2018-08-21 15:22:47 UTC
                        RTC time: Tue 2018-08-21 10:22:37
                       Time zone: US/Central (CDT, -0500)
       System clock synchronized: no
systemd-timesyncd.service active: yes
                 RTC in local TZ: yes

Warning: The system is configured to read the RTC time in the local time zone.
         This mode cannot 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'.

The warning is something we have to live with in order to work with an inferior operating system. These two lines:

systemd-timesyncd.service active: yes
                     RTC in local TZ: yes

Tip: For Windows/Linux dual boot or multi-boot systems all Linux systems should show RTC time and Local time as the same.

show us that the time sync service is active and should be working and the RTC is set to yes or local TZ which you need to work with Windows. So reboot and all should be hunky dory.

Let me know if anyone has problems and I’ll try to figure out what’s what.

What is bothering me and what caused the interruption above is this line:

$ timedatectl
...
System clock synchronized: no
...

I can finagle a way to make that say yes but typically in OMLx 3 it is always on no. Don’t know why. I’m thinking we need for @TPG to explain this to us.

I do know that with the above actions, in general, time and date work well in Lx 3. It may be that that line is giving false information or is nothing to be concerned about, don’t know.

I also know that for dual boot or multi-boot users time occasionally gets messed up and it is difficult or impossible to know the cause unless you actually see it happen. The majority of the time all you can do is correct it hence one needs to know and understand how this works.

Note: The above is for those dual or multi booting with Windows only. If you are a Linux only user you want your RTC set to UTC ergo ‘RTC in local TZ: no’. This is set with:

$ timedatectl
                      Local time: Tue 2018-08-21 05:52:29 CDT
                  Universal time: Tue 2018-08-21 10:52:29 UTC
                        RTC time: Tue 2018-08-21 10:52:29
                       Time zone: US/Central (CDT, -0500)
       System clock synchronized: no
systemd-timesyncd.service active: yes
                 RTC in local TZ: no

Tip: For Linux only systems RTC time and UTC time should be the same.

Maybe this could help. No ay to test here ;).

1 Like

Probably not a great idea for most people posting on this forum. It is and has been for years considered to be easier to correct this from the Linux side rather than the Windows side. The other way is possible but. And there is zero chance I’m going to get in to helping users with problems in Windows on this forum.

So if anyone wants to try to fix this on their Windows system instead of their Linux system I say go for it. If you run in to issues then ask for help on a Windows forum. There are plenty of them and some are very good. I’ve used them myself.

URL Fixed. Thanks :slight_smile:.

1 Like

To simplify this whole deal:

If you have an incorrect time issue in Linux on a dual boot with Windows system do this:

Check your Linux system:

$ timedatectl
                      Local time: Tue 2018-08-21 13:11:23 CDT
                  Universal time: Tue 2018-08-21 18:11:23 UTC
                        RTC time: Tue 2018-08-21 18:11:22
                       Time zone: US/Central (CDT, -0500)
       System clock synchronized: no
systemd-timesyncd.service active: yes
                 RTC in local TZ: no

We are concerned about that last line only. If it says ‘RTC in local TZ: yes’ then you are set correctly and there is some other problem. But more than likely you will see just what I have posted and RTC in local TZ is set to no. To correct:

$ sudo timedatectl set-local-rtc 1 --adjust-system-clock

Then to check run ‘timedatectl’ again and you should see:

$ timedatectl
                      Local time: Tue 2018-08-21 18:15:28 CDT
                  Universal time: Tue 2018-08-21 23:15:28 UTC
                        RTC time: Tue 2018-08-21 18:15:28
                       Time zone: US/Central (CDT, -0500)
       System clock synchronized: no
systemd-timesyncd.service active: yes
                 RTC in local TZ: yes

Warning: The system is configured to read the RTC time in the local time zone.
         This mode cannot 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'.

That is what you want. You’re done. That’s it that’s all there is to correcting this. (That warning is just something we have to live with in order to work with the inferior operating system).

Post-edit: This is of course assuming you already have correct time in Windows. If not, correct that and then go back to your Linux system and repeat the above steps.

1 Like

I just made a How To here.

1 Like

I do want to know if this does/does not work for OP @vhelmont?

That no longer exists in Lx 3. Time and date are controlled by timedatectl/systemd so the commands mentioned in the previous posts for timedatectl and systemd are how to check this currently. Sorry I did not address this question first before explaining how to correct the issue.

Just to reiterate in your first post you have ‘RTC in local TZ: no’ which is not correct for your dual boot setup and needs to be set to ‘yes’ which should correct your issue. Also the fact that the incorrect time is exactly the same as the offset between your TZ and UTC confirms this.

Hello Ben,

Sorry for my bluntness but your reply made me overreact a little.
Thanks for the info anyway.

Regards,
Albert

1 Like

That’s OK. Sometimes I have said things that aren’t taken well by other people so I do try to be cognizant of that and correct myself where warranted. Plus I had honestly forgotten the origin of that slang term. A good example of why we aren’t supposed to use slang terms in an international forum.

The important thing is whether my information helped you resolve your issue with incorrect time in OMLx 3?

1 Like

It did help me understand and solve the problem.

Regards,
Albert

1 Like