You are not logged in.

#1 2019-05-26 18:33:07

LyCC
Member
Registered: 2012-09-05
Posts: 155

No time sync: NTPD doesn't sync - systemd-timesyncd.service fails

Hi everyone,

Well, i guess Friday the 13th came early,
first of all, NTPD stopped working

May 26 00:12:29 ArchPC systemd[1]: Started Network Time Service.
May 26 00:12:29 ArchPC ntpd[12476]: proto: precision = 0.044 usec (-24)
May 26 00:12:29 ArchPC ntpd[12476]: basedate set to 2019-03-01
May 26 00:12:29 ArchPC ntpd[12476]: gps base set to 2019-03-03 (week 2043)
May 26 00:12:29 ArchPC ntpd[12476]: Listen and drop on 0 v6wildcard [::]:123
May 26 00:12:29 ArchPC ntpd[12476]: Listen and drop on 1 v4wildcard 0.0.0.0:123
May 26 00:12:29 ArchPC ntpd[12476]: Listen normally on 2 lo 127.0.0.1:123
May 26 00:12:29 ArchPC ntpd[12476]: Listen normally on 3 eno1 192.168.1.10:123
May 26 00:12:29 ArchPC ntpd[12476]: Listen normally on 4 lo [::1]:123
May 26 00:12:29 ArchPC ntpd[12476]: Listen normally on 5 eno1 [fe80::43c2:4683:f20f:1be5%2]:123
May 26 00:12:29 ArchPC ntpd[12476]: Listening on routing socket on fd #22 for interface updates
May 26 00:12:29 ArchPC ntpd[12476]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized
May 26 00:12:29 ArchPC ntpd[12476]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized

however

ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 time.conova.com .GPS.            1 u   43   64    3   41.969  -107997   1.114
 omx2.classictic 131.188.3.223    2 u   40   64    3   39.339  -107997   0.001
 srv146.personal 82.76.255.6      4 u   43   64    3   17.189  -107997   2.954
 ntp1.chroot.ro  210.100.177.101  2 u   42   64    3    7.396  -107997   0.140
 ntp0.chroot.ro  194.29.130.252   2 u   46   64    3    6.860  -107997   0.026
 ups.alsys.ro    .GCC.            1 u   43   64    3    8.648  -107997   0.103

seems to output just fine. Stopping the ntpd and manually syncing with one of the servers from the config file works, however the daemon
doesn't do anything, i let it for a couple of hours nothing, rebooted, waited, nothing ...

Then i give systemd-timesyncd.service a try, which obviously doesn't work either ...

May 26 00:24:27 ArchPC systemd[1]: Starting Network Time Synchronization...
May 26 00:24:27 ArchPC systemd[12886]: systemd-timesyncd.service: Failed to execute command: No such file or directory
May 26 00:24:27 ArchPC systemd[12886]: systemd-timesyncd.service: Failed at step EXEC spawning /usr/lib/systemd/systemd-timesy>
May 26 00:24:27 ArchPC systemd[1]: systemd-timesyncd.service: Main process exited, code=exited, status=203/EXEC
May 26 00:24:27 systemd[1]: Failed to start Network Time Synchronization.

and of course as suggested here: https://github.com/systemd/systemd/issues/12131 and in other posts of the forum, removing
the /var/lib/systemd/timesync folder doesn't solve it, when i restart the service that folder gets created but the same output message.

Any suggestions / ideas is greatly appreciated.

Offline

#2 2019-05-26 22:04:20

twelveeighty
Member
From: Alberta, Canada
Registered: 2011-09-04
Posts: 1,096

Re: No time sync: NTPD doesn't sync - systemd-timesyncd.service fails

Post the output of the following two commands:

$ timedatectl

$ file /usr/lib/systemd/systemd-timesyncd

Use the first command to check if your hardware clock is far off from your system clock. If it is, it can take a while for ntp to catch up. The 2nd command may shed some light into the "no such file or directory" error returned from starting systemd-timesyncd.

Offline

#3 2019-05-26 22:26:25

LyCC
Member
Registered: 2012-09-05
Posts: 155

Re: No time sync: NTPD doesn't sync - systemd-timesyncd.service fails

Thank you, here they are:

timedatectl
               Local time: Mon 2019-05-27 04:16:22 EEST
           Universal time: Mon 2019-05-27 01:16:22 UTC
                 RTC time: Mon 2019-05-27 01:16:22
                Time zone: Europe/Bucharest (EEST, +0300)
System clock synchronized: no
              NTP service: inactive
          RTC in local TZ: no
System clock synchronized: no
              NTP service: inactive
          RTC in local TZ: no
file /usr/lib/systemd/systemd-timesyncd
/usr/lib/systemd/systemd-timesyncd: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=a8340b8483414e905ef0af95b04f72c4935d1254, for GNU/Linux 3.2.0, stripped

Offline

#4 2019-05-26 23:35:02

Zod
Member
From: Hoosiertucky
Registered: 2019-03-10
Posts: 629

Re: No time sync: NTPD doesn't sync - systemd-timesyncd.service fails

LyCC wrote:

seems to output just fine.

If I'm not mistaken, what ntpq -p is showing is that it can resolve the servers and talk to them but has, as of yet,  chosen not to sync time with them.


From https://wiki.archlinux.org/index.php/Ne … ng_sockets

The servers ntpd is synchronizing with are prefixed by an asterisk.


Should look like this...



remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
+li216-154.membe 69.28.91.73      3 u   24   64  177   43.872   -3.087   7.487
+io.crash-overri 129.7.1.66       2 u    4   64  377   45.571   -2.031   7.015
+2600:3c02::2:32 218.73.139.35    2 u   18   64  377   53.293   12.811   7.334
*107.155.79.108  129.7.1.66       2 u   19   64  377   45.121   -1.062   6.722




May 26 00:12:29 ArchPC ntpd[12476]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized
May 26 00:12:29 ArchPC ntpd[12476]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized

I think these messages are trivial, you might try syncing with different servers.



Edit: I'm not sure what to make of this...

              
System clock synchronized: no
              NTP service: inactive
          RTC in local TZ: no
System clock synchronized: no
              NTP service: inactive
          RTC in local TZ: no

Do you have 2 network interfaces connected?

Last edited by Zod (2019-05-27 00:04:32)

Offline

#5 2019-05-27 07:12:20

LyCC
Member
Registered: 2012-09-05
Posts: 155

Re: No time sync: NTPD doesn't sync - systemd-timesyncd.service fails

thank you for your answer,

no, i don't have two interfaces, that duplicate is my mistake, i missed the first line and copy pasted again (forgot to overwrite the last 3 lines), sorry about that, was late night.

As a completion, the daemon seems to be running:

● ntpd.service - Network Time Service
   Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2019-05-27 04:17:50 EEST; 5h 50min ago
  Process: 1953 ExecStart=/usr/bin/ntpd -g -u ntp:ntp (code=exited, status=0/SUCCESS)
 Main PID: 1955 (ntpd)
    Tasks: 2 (limit: 4915)
   Memory: 2.5M
   CGroup: /system.slice/ntpd.service
           └─1955 /usr/bin/ntpd -g -u ntp:ntp

May 27 11:39:45 ArchPC ntpd[1955]: 217.73.163.62 local addr 192.168.1.10 -> <null>
May 27 11:39:45 ArchPC ntpd[1955]: 92.86.106.228 local addr 192.168.1.10 -> <null>
May 27 11:39:45 ArchPC ntpd[1955]: 193.22.95.9 local addr 192.168.1.10 -> <null>
May 27 11:39:45 ArchPC ntpd[1955]: 2.59.133.224 local addr 192.168.1.10 -> <null>
May 27 11:39:45 ArchPC ntpd[1955]: 94.199.173.123 local addr 192.168.1.10 -> <null>
May 27 11:39:45 ArchPC ntpd[1955]: Deleting interface #5 eno1, fe80::43c2:4683:f20f:1be5%2#123, interface stats: received=0, sent=0, dropped=0, active_time=2475 secs
May 27 11:39:50 ArchPC ntpd[1955]: Listen normally on 6 eno1 [fe80::43c2:4683:f20f:1be5%2]:123
May 27 11:39:50 ArchPC ntpd[1955]: new interface(s) found: waking up resolver
May 27 11:39:54 ArchPC ntpd[1955]: Listen normally on 7 eno1 192.168.1.10:123
May 27 11:39:54 ArchPC ntpd[1955]: new interface(s) found: waking up resolver

Offline

#6 2019-05-27 16:58:48

twelveeighty
Member
From: Alberta, Canada
Registered: 2011-09-04
Posts: 1,096

Re: No time sync: NTPD doesn't sync - systemd-timesyncd.service fails

Your offset (-107997) is VERY large. It could be taking forever to get sync'd. I think it only adjusts the clock every second or so. Try shutting down ntpd and then manually bring your hardware and system clocks closer to reality. Then start ntpd again.

Offline

#7 2019-05-27 17:52:01

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,739

Re: No time sync: NTPD doesn't sync - systemd-timesyncd.service fails

twelveeighty wrote:

Your offset (-107997) is VERY large. It could be taking forever to get sync'd. I think it only adjusts the clock every second or so. Try shutting down ntpd and then manually bring your hardware and system clocks closer to reality. Then start ntpd again.

And that period is almost exactly 30 hours in the event that is a clue.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#8 2019-05-31 08:21:27

LyCC
Member
Registered: 2012-09-05
Posts: 155

Re: No time sync: NTPD doesn't sync - systemd-timesyncd.service fails

Ok, thank you everyone,

I had the wrong idea on how NTPD works (I thought it will always sync, which isn't the case if the diff. is over the threshold).

Offline

#9 2019-05-31 16:21:03

loqs
Member
Registered: 2014-03-06
Posts: 17,195

Re: No time sync: NTPD doesn't sync - systemd-timesyncd.service fails

I thought as the ntpd service started ntpd with the -g option it would allow the offset to initially exceed the panic threshold see man 1 ntpd.

Offline

#10 2019-05-31 18:44:53

LyCC
Member
Registered: 2012-09-05
Posts: 155

Re: No time sync: NTPD doesn't sync - systemd-timesyncd.service fails

Seems to be started with "-g" which doesn't seem to work ...

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

Offline

#11 2019-05-31 19:56:01

loqs
Member
Registered: 2014-03-06
Posts: 17,195

Re: No time sync: NTPD doesn't sync - systemd-timesyncd.service fails

Strange.  I did the following:

# systemctl stop ntpd.service
# systemctl stop

Set the time back 30 hours from firmware menu,  continued booting (which triggered a forced fsck as time had gone backwards)
ntpd.service started correctly after syncing to a remote it skipped the clock forward to the correct time.

Offline

#12 2019-05-31 20:45:32

LyCC
Member
Registered: 2012-09-05
Posts: 155

Re: No time sync: NTPD doesn't sync - systemd-timesyncd.service fails

Let's blame M$, still need it for ad$be, changes the clock ... anyway, restart into Arch, the time doesn't get sync any more until I stop the ntpd, sync manually, and restart ntpd. Until
I don't enter win, NTPD works fine, PC put to sleep, start up, clock syncs, entering win, doing my work, restart into Arch, clock doesn't sync any more. I am getting bored of always
manually syncing the time, I am thinking of creating a batch file that stops NTPD, executes the sync command, restarts NTPD, maybe someone has a better idea how to solve this?
Btw, systemd-timesyncd.service still fails, even after the recent updates. Maybe I am just unlucky?

Offline

#13 2019-05-31 20:59:30

loqs
Member
Registered: 2014-03-06
Posts: 17,195

Re: No time sync: NTPD doesn't sync - systemd-timesyncd.service fails

Offline

#14 2019-06-03 07:02:39

LyCC
Member
Registered: 2012-09-05
Posts: 155

Re: No time sync: NTPD doesn't sync - systemd-timesyncd.service fails

Thank you all,

loqs: haven't set it yet, but I will.

However the -g option for the ntpd should sync the clock when the system first starts, right? I wonder why that isn't working ... (or the systemd-timesyncd.service).

Offline

Board footer

Powered by FluxBB