You are not logged in.

#1 2024-04-13 09:43:53

othersamo_
Member
From: Braislava
Registered: 2020-10-26
Posts: 125

Cannot synchronize time

Hello,
I am trying to synchronize time on my archlinux install. I have been using ntpd but that broke and my clock is now 23.8 second ahead. It was installed as a service that was meant to start at the boot. I wanted to restart the service but after the service shut down, it hanged and did not turn back on.

I also tried switching to chrony but it refuses to start, as well and does not synchronize my clock despite the fact I set 2 servers it should synchronize with:
pool 2.arch.pool.ntp.org iburst
pool pool.ntp.org iburst maxsources 4

However, for fix I prefer ntp because it worked for 2 years, just broke recently.
Is there any way I can have a simple and reliable time synchronization method?
Thank you

Last edited by othersamo_ (2024-04-13 10:02:13)


"Why join the navy if you can be a pirate?"
- Steve Jobs

Offline

#2 2024-04-13 10:02:03

just4arch
Member
Registered: 2023-01-07
Posts: 84

Re: Cannot synchronize time

Well, there's systemd-timesyncd, but there seems to be another problem that needs fixing first...
You might want to share the logs of the failed starts of ntpd and chrony.

Offline

#3 2024-04-13 12:36:06

seth
Member
Registered: 2012-09-03
Posts: 51,608

Re: Cannot synchronize time

been using ntpd but that broke …  for fix I prefer ntp

So how exactly idid it "break"?
https://bbs.archlinux.org/viewtopic.php?id=57855
Does the service not start, does it fail to reach a time server, …?
For basic functionality so we're not wasting time on NTP over a broken network:

ping 2.arch.pool.ntp.org

Offline

#4 2024-04-13 18:27:37

othersamo_
Member
From: Braislava
Registered: 2020-10-26
Posts: 125

Re: Cannot synchronize time

The issue is it runs 23 seconds ahead. When I turned the service off, synced the time with ntpdate pool.ntp.org, I was good to go until the next boot. Then I was again out of sync by 23 seconds. I tried setting my NTP config to the same server but that did not solve the issue
Log:

Apr 13 19:24:42 Samo-PCTP ntpd[611]: ----------------------------------------------------
Apr 13 19:24:42 Samo-PCTP ntpd[611]: DEBUG behavior is enabled - a violation of any
Apr 13 19:24:42 Samo-PCTP ntpd[611]: diagnostic assertion will cause ntpd to abort
Apr 13 19:24:42 Samo-PCTP ntpd[615]: proto: precision = 0.219 usec (-22)
Apr 13 19:24:42 Samo-PCTP ntpd[615]: basedate set to 2023-05-25
Apr 13 19:24:42 Samo-PCTP ntpd[615]: gps base set to 2023-05-28 (week 2264)
Apr 13 19:24:42 Samo-PCTP ntpd[615]: restrict: ignoring line 9, mask '::' unusable.
Apr 13 19:24:42 Samo-PCTP ntpd[615]: initial drift restored to 0.000000
Apr 13 19:24:42 Samo-PCTP ntpd[615]: switching logging to file /var/log/ntp.log
Apr 13 19:24:42 Samo-PCTP systemd[1]: Started Network Time Service.

Apart from the error on the line 9 (which is blank), it starts normally and seems to be up.

Systemd-timesyncd is disabled.

Last edited by othersamo_ (2024-04-13 18:33:25)


"Why join the navy if you can be a pirate?"
- Steve Jobs

Offline

#5 2024-04-13 19:14:20

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,958

Re: Cannot synchronize time

Apr 13 19:24:42 Samo-PCTP ntpd[615]: initial drift restored to 0.000000

That is likely the problem.

The location for the drift file is set in /etc/ntp.conf , please post its contents.
(typical location for drift file is /var/lib/ntp/ntp.drift )


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

Board footer

Powered by FluxBB