You are not logged in.

#1 2020-07-01 23:49:56

Straight-path
Banned
Registered: 2020-06-28
Posts: 66

System clock and Hardware Clock [SOLVED]

Hi,

I was just hoping someone could help me work out If I've set the time correctly on my system. When I did the install I did

 timedatectl set-ntp true

and

 hwclock --systohc

and after I installed the Desktop Environment I installed ntp and enabled ntpd.service.

 timedatectl status

gives me:

 Local time: Thu 2020-07-02 00:41:43 BST
           Universal time: Wed 2020-07-01 23:41:43 UTC
                 RTC time: Wed 2020-07-01 23:41:43    
                Time zone: Europe/London (BST, +0100) 
System clock synchronized: yes                        
              NTP service: inactive                   
          RTC in local TZ: no  
 systemctl status ntpd

gives me:

  Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled; vendor preset: disabled)
     Active: active (running) since Thu 2020-07-02 00:22:41 BST; 20min ago
    Process: 377 ExecStart=/usr/bin/ntpd -g -u ntp:ntp (code=exited, status=0/SUCCESS)
   Main PID: 395 (ntpd)
      Tasks: 2 (limit: 18811)
     Memory: 4.1M
     CGroup: /system.slice/ntpd.service
             └─395 /usr/bin/ntpd -g -u ntp:ntp

Jul 02 00:22:41 The-Eagle ntpd[395]: Listen normally on 3 lo [::1]:123
Jul 02 00:22:41 The-Eagle ntpd[395]: Listening on routing socket on fd #20 for interface updates
Jul 02 00:22:41 The-Eagle ntpd[395]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized
Jul 02 00:22:41 The-Eagle ntpd[395]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized
Jul 02 00:22:41 The-Eagle systemd[1]: Started Network Time Service.
Jul 02 00:22:55 The-Eagle ntpd[395]: Listen normally on 4 wlp0s20f3 [fe80::ef06:d09c:6b23:362a%2]:123
Jul 02 00:22:55 The-Eagle ntpd[395]: new interface(s) found: waking up resolver
Jul 02 00:22:58 The-Eagle ntpd[395]: Listen normally on 5 wlp0s20f3 192.168.0.9:123
Jul 02 00:22:58 The-Eagle ntpd[395]: new interface(s) found: waking up resolver
Jul 02 00:31:45 The-Eagle ntpd[395]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized

I don't know why there's the kernel error saying clock unsynchronized.

when I set up reflector it seems to be going by UTC time

 ################################################################################
################# Arch Linux mirrorlist generated by Reflector #################
################################################################################

# With:       reflector --country France --country Germany --country UK --age 12 --protocol https --sort rate --save /etc/pacman.d/m>
# When:       2020-07-01 18:36:00 UTC
# From:       https://www.archlinux.org/mirrors/status/json/
# Retrieved:  2020-07-01 18:35:52 UTC
# Last Check: 2020-07-01 18:16:08 UTC

To be honest I don't have a clue about all this time stuff and am totally confused. I just want to know if its configured correctly so I won't have issues with it in the future. The time on my screen is correct for my local time.

Any help would be much appreciated.

Can someone help me correct the time if that is needed and explain how I can make sure it stays synchronized. I did think I had set the time correctly and that ntpd was going to keep it synchronized.




Anyone hopefully someone who doesn't mind explaining things in a bit more detail without just directing me to the wiki. I do understand the intention of directing someone to the wiki. I have put it a serious amount of effort to just get a basic arch install and desktop environment setup. From scratch not long ago I started learning about Linux and only after installing arch have I asked a couple of questions.

I'm still stuck and quite confused with the whole issue of setting the time. Not only am I new to Arch but I am new to Linux too. I don't want to give up on Arch now that I've come this far and spent so many weeks to get to where I am. I had read the appropriate wiki pages before I first posted here and then again after being directed back to them, but sadly the wiki isn't written for absolute novices like me and I've struggled immensely trying to understand anything from it.

I have a few questions.

1) how does One clarify there system time and hardware clock is correct or wrong?

2) how to set up a time synchronisation service correctly so the time issue never needs to be a concern again?

3) If I was to do a fresh install using

 timedatectl set-ntp true

and also

 hwclock --systohc

and then after installing the desktop environment if I disabled

systemd-timesyncd.service

and then installed ntp and enabled

 systemctl enable --now ntpd.service

would/should all my time issues be resolved?

Last edited by Straight-path (2020-07-02 19:05:24)

Offline

#2 2020-07-02 00:02:23

loqs
Member
Registered: 2014-03-06
Posts: 18,859

Re: System clock and Hardware Clock [SOLVED]

cat /usr/lib/systemd/system/ntpd.service
[Unit]
Description=Network Time Service
After=network.target nss-lookup.target
Conflicts=systemd-timesyncd.service

[Service]
Type=forking
PrivateTmp=true
ExecStart=/usr/bin/ntpd -g -u ntp:ntp
Restart=always

[Install]
WantedBy=multi-user.target

timedatectl set-ntp true enabled systemd-timesyncd.service but as ntpd.service lists it as conflicting it will not be started when ntpd.service is started.

Offline

#3 2020-07-02 00:06:09

Straight-path
Banned
Registered: 2020-06-28
Posts: 66

Re: System clock and Hardware Clock [SOLVED]

So am I meant to disable one of the services?

Offline

#4 2020-07-02 00:32:37

loqs
Member
Registered: 2014-03-06
Posts: 18,859

Re: System clock and Hardware Clock [SOLVED]

Straight-path wrote:

So am I meant to disable one of the services?

Yes see System_time#Time_synchronization for a full list of choices.

Offline

#5 2020-07-02 17:53:37

Straight-path
Banned
Registered: 2020-06-28
Posts: 66

Re: System clock and Hardware Clock [SOLVED]

Not sure if I was just meant to edit my original post or write here.

Anyone hopefully someone who doesn't mind explaining things in a bit more detail without just directing me to the wiki. I do understand the intention of directing someone to the wiki. I have put it a serious amount of effort to just get a basic arch install and desktop environment setup. From scratch not long ago I started learning about Linux and only after installing arch have I asked a couple of questions.

I'm still stuck and quite confused with the whole issue of setting the time. Not only am I new to Arch but I am new to Linux too. I don't want to give up on Arch now that I've come this far and spent so many weeks to get to where I am. I had read the appropriate wiki pages before I first posted here and then again after being directed back to them, but sadly the wiki isn't written for absolute novices like me and I've struggled immensely trying to understand anything from it.

I have a few questions.

1) how does One clarify there system time and hardware clock is correct or wrong?

2) how to set up a time synchronisation service correctly so the time issue never needs to be a concern again?

3) If I was to do a fresh install using

 timedatectl set-ntp true

and also

 hwclock --systohc

and then after installing the desktop environment if I disabled

systemd-timesyncd.service

and then installed ntp and enabled

 systemctl enable --now ntpd.service

would/should all my time issues be resolved?

Offline

#6 2020-07-02 18:00:36

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,612

Re: System clock and Hardware Clock [SOLVED]

I think that would resolve your problems.   One of the advantages of Arch Linux is that there are more than one way to accomplish things so you can configure things to your liking.  A problem arises when one tries to have more than one thing solve a problem at one time.  Turning on multiple services to control networks causes problems as the services fight for control.  Looks like the same thing happens with time synchronization.

Unless you need to provide an NTP server, I suggest the other tack.  Disable the ntp service, and leave the systemd-timesync service enabled.  If all goes well, you will then get output like this:

ewaller@odin/home/ewaller % timedatectl 
               Local time: Thu 2020-07-02 10:59:15 PDT     
           Universal time: Thu 2020-07-02 17:59:15 UTC     
                 RTC time: Thu 2020-07-02 17:59:15         
                Time zone: America/Los_Angeles (PDT, -0700)
System clock synchronized: yes                             
              NTP service: active                          
          RTC in local TZ: no                              
ewaller@odin/home/ewaller % 

instead of the abbreviated version you had above.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#7 2020-07-02 18:21:10

Straight-path
Banned
Registered: 2020-06-28
Posts: 66

Re: System clock and Hardware Clock [SOLVED]

Thank you very much.

Sorry what did you mean by the abbreviated output I had?

Yeah I didn't realise that

 timedatectl set-ntp true

started a time service.

So what your saying is that

 timedatectl set-ntp true

and

 hwclock --systohc

those commands are enough to have the time synced correctly and that timdedatectl is a synchronisation service and it should maintain my system time corrctly?

Offline

#8 2020-07-02 18:23:16

Straight-path
Banned
Registered: 2020-06-28
Posts: 66

Re: System clock and Hardware Clock [SOLVED]

I'm assuming when you look at the output I posted before from

timedatectl status

you can tell the my system time isn't set correctly. What is it that signifies the system time is wrong? because the time on my desktop is correct for my local time.

Offline

#9 2020-07-02 18:24:51

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,612

Re: System clock and Hardware Clock [SOLVED]

Yes.   But, after doing so, post the output of your timedatectl. 
I guess I was wrong about abreviated; but rater that yours said that ntp was inactive.   When I read your output yesterday, I thought it had been missing a line or two.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#10 2020-07-02 18:29:37

Straight-path
Banned
Registered: 2020-06-28
Posts: 66

Re: System clock and Hardware Clock [SOLVED]

Yesterday I had disabled both time services and re enabled ntpd is this correct or still the same. lol sorry I don't know what to look for to discern whether the time is correct or wrong.

 [muj@The-Eagle ~]$ timedatectl status
               Local time: Thu 2020-07-02 19:27:59 BST
           Universal time: Thu 2020-07-02 18:27:59 UTC
                 RTC time: Thu 2020-07-02 18:27:59    
                Time zone: Europe/London (BST, +0100) 
System clock synchronized: yes                        
              NTP service: inactive                   
          RTC in local TZ: no    

Offline

#11 2020-07-02 18:32:02

Straight-path
Banned
Registered: 2020-06-28
Posts: 66

Re: System clock and Hardware Clock [SOLVED]

ntpd is enable

 [muj@The-Eagle ~]$ systemctl status ntpd
● ntpd.service - Network Time Service
     Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled; vendor preset: disabled)
     Active: active (running) since Thu 2020-07-02 18:25:55 BST; 1h 4min ago
    Process: 350 ExecStart=/usr/bin/ntpd -g -u ntp:ntp (code=exited, status=0/SUCCESS)
   Main PID: 356 (ntpd)
      Tasks: 2 (limit: 18811)
     Memory: 4.5M
     CGroup: /system.slice/ntpd.service
             └─356 /usr/bin/ntpd -g -u ntp:ntp

Jul 02 19:04:01 The-Eagle ntpd[356]: Deleting interface #9 wlp0s20f3, 192.168.0.9#123, interface stats: received=48, sent=75, droppe>
Jul 02 19:04:01 The-Eagle ntpd[356]: 139.162.219.252 local addr 192.168.0.9 -> <null>
Jul 02 19:04:01 The-Eagle ntpd[356]: 185.53.93.157 local addr 192.168.0.9 -> <null>
Jul 02 19:04:01 The-Eagle ntpd[356]: 81.21.65.169 local addr 192.168.0.9 -> <null>
Jul 02 19:04:01 The-Eagle ntpd[356]: 83.137.225.103 local addr 192.168.0.9 -> <null>
Jul 02 19:04:01 The-Eagle ntpd[356]: Deleting interface #10 wlp0s20f3, fe80::ef06:d09c:6b23:362a%2#123, interface stats: received=0,>
Jul 02 19:04:04 The-Eagle ntpd[356]: Listen normally on 11 wlp0s20f3 192.168.0.9:123
Jul 02 19:04:04 The-Eagle ntpd[356]: Listen normally on 12 wlp0s20f3 [fe80::ef06:d09c:6b23:362a%2]:123
Jul 02 19:04:04 The-Eagle ntpd[356]: new interface(s) found: waking up resolver
Jul 02 19:09:06 The-Eagle ntpd[356]: no peer for too long, server running free now

and

 systemd-timesyncd.service

is disabled

Offline

#12 2020-07-02 18:33:03

Straight-path
Banned
Registered: 2020-06-28
Posts: 66

Re: System clock and Hardware Clock [SOLVED]

 [muj@The-Eagle ~]$ systemctl status systemd-timesyncd.service
● systemd-timesyncd.service - Network Time Synchronization
     Loaded: loaded (/usr/lib/systemd/system/systemd-timesyncd.service; disabled; vendor preset: enabled)
     Active: inactive (dead)
       Docs: man:systemd-timesyncd.service(8)
[muj@The-Eagle ~]$ 

Offline

#13 2020-07-02 18:35:46

Straight-path
Banned
Registered: 2020-06-28
Posts: 66

Re: System clock and Hardware Clock [SOLVED]

from

 timedatectl

will it say NTP service active for all network time protocol services? for ntpd and also for systemd-timesyncd.service?

Offline

#14 2020-07-02 18:37:16

Straight-path
Banned
Registered: 2020-06-28
Posts: 66

Re: System clock and Hardware Clock [SOLVED]

If thats the case maybe I need to disable all time services and

 sudo pacman Rns ntp

then reinstall ntp and enable ntpd

Offline

#15 2020-07-02 18:39:55

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,612

Re: System clock and Hardware Clock [SOLVED]

It does look like it is synchronized,  but it shows that NTP service is inactive.  I think that means something beside systemd is processing NTP, probably ntpd

You can leave it alone, and I think you are good.  But, you are running in a more complex mode than you need.
If you don't need to provide ntp as a server, disable ntpd service and restart.   See if timedatectl shows NTP as active.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#16 2020-07-02 18:47:11

Straight-path
Banned
Registered: 2020-06-28
Posts: 66

Re: System clock and Hardware Clock [SOLVED]

okay. I'm going to delete ntpd and remove the service then i'll do

 timedatectl set-ntp true

and

 hwclock --sytohc

and then i'll post the output of

 timedatectl status

again.

Seriously thank you for your patience and help!

Offline

#17 2020-07-02 18:49:52

Straight-path
Banned
Registered: 2020-06-28
Posts: 66

Re: System clock and Hardware Clock [SOLVED]

[muj@The-Eagle ~]$ timedatectl status
               Local time: Thu 2020-07-02 19:49:25 BST
           Universal time: Thu 2020-07-02 18:49:25 UTC
                 RTC time: Thu 2020-07-02 18:49:25    
                Time zone: Europe/London (BST, +0100) 
System clock synchronized: yes                        
              NTP service: active                     
          RTC in local TZ: no                         
[muj@The-Eagle ~]$ 

Offline

#18 2020-07-02 18:51:36

Straight-path
Banned
Registered: 2020-06-28
Posts: 66

Re: System clock and Hardware Clock [SOLVED]

Looks like yours. So I take it thats correct and the only thing for time that needs to be done in an Arch install is

timedatectl set-ntp true

and

 hwclock --systohc

. Is that correct?

Offline

#19 2020-07-02 18:52:15

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,612

Re: System clock and Hardware Clock [SOLVED]

Yes.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#20 2020-07-02 18:57:16

Straight-path
Banned
Registered: 2020-06-28
Posts: 66

Re: System clock and Hardware Clock [SOLVED]

haha. I'm very happy, relieved and grateful. I hope I can help other people with Linux one day the way you have just helped me. I know the issue to you must seem very basic.

I'm hoping with time the wiki will become easier for me to comprehend.

truly appreciated, thank you very much.

Last edited by Straight-path (2020-07-02 18:58:08)

Offline

#21 2020-07-02 19:04:51

Straight-path
Banned
Registered: 2020-06-28
Posts: 66

Re: System clock and Hardware Clock [SOLVED]

What had happened was that after I had finally installed Arch correctly, I did read the wiki about maintaining an Arch system but I also googled it and followed someones instructions online about ntpd. They didn't mention about disabling

systemd-timesyncd.service

. I suppose that's an example of why following online tutorials isn't the best thing to do.

The first time I had installed Arch correctly was by copying someone on Youtube using systemd as a bootloader. I was so satisfied when I was able to install Arch using grub and working it out on my own from the wiki.

Offline

Board footer

Powered by FluxBB