You are not logged in.

#1 2016-12-02 20:15:01

ratcheer
Member
Registered: 2011-10-09
Posts: 912

[Solved] I'm somewhat confused about systemd-timesyncd

Everything seems to be configured and running, but I do not get the synchronization messages like others report. All I get is:

 Dec 02 13:29:55 tim-arch-ssd systemd-timesyncd[332]: Synchronized to time server 69.89.207.199:123 (2.us.pool.ntp.org).

Which appears to be successful, but other people say they get messages that look like:

 Jun 11 18:20:49 locsmxp systemd-timesyncd[126]: interval/delta/delay/jitter/drift 64s/+0.000s/0.000s/0.000s/+0ppm

There is nothing like that in my journal.

Also, the documentation states that after synchronization, file /var/lib/systemd/clock will contain the most recent timestamp. However, on my system, that file remains empty:

 # ls -l /var/lib/systemd/clock
-rw-r--r-- 1 systemd-timesync systemd-timesync 0 Dec  2 14:04 /var/lib/systemd/clock

Am I misinterpreting the situation, or is there something else I need to do to make this work?

Tim

Last edited by ratcheer (2016-12-03 13:15:34)

Offline

#2 2016-12-03 13:16:32

ratcheer
Member
Registered: 2011-10-09
Posts: 912

Re: [Solved] I'm somewhat confused about systemd-timesyncd

It was blocked by the firewall.

Tim

Offline

#3 2016-12-03 13:23:46

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: [Solved] I'm somewhat confused about systemd-timesyncd

ratcheer wrote:

It was blocked by the firewall.

Which port/ports did you need to open?  I don't have anything specific in my firewall config and I see lines like the following in my journactl like you mentioned:

Nov 26 04:54:22 easy systemd-timesyncd[518]: Synchronized to time server 67.227.252.196:123 (2.arch.pool.ntp.org).

But nothing indicating any clock drift.

Last edited by graysky (2016-12-03 13:27:51)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#4 2016-12-03 13:52:39

ratcheer
Member
Registered: 2011-10-09
Posts: 912

Re: [Solved] I'm somewhat confused about systemd-timesyncd

It turned out not to be the ports. In trying to fix things, I had tried several slightly varied suggestions about opening port 123, but they did not help.

I finally found out that I needed to allow traffic from localhost to localhost. That fixed it. The two rules I added were:

-A INPUT -p all -j ACCEPT -s 127.0.0.1 -d 127.0.0.1
-A OUTPUT -p all -j ACCEPT -s 127.0.0.1 -d 127.0.0.1

I'm not sure the second rule was needed, because all OUTPUT was supposed to already be allowed. But it's working, and I'm tired of messing with it.

Tim

PS - I also had to add analogous rules to ip6tables.

Last edited by ratcheer (2016-12-03 13:53:49)

Offline

#5 2016-12-03 15:17:28

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: [Solved] I'm somewhat confused about systemd-timesyncd

@op - When you said it's working, does that mean that you now have lines in your journalctl like:

systemd-timesyncd[126]: interval/delta/delay/jitter/drift 64s/+0.000s/0.000s/0.000s/+0ppm

?


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#6 2016-12-03 17:07:41

ukhippo
Member
From: Non-paged pool
Registered: 2014-02-21
Posts: 366

Re: [Solved] I'm somewhat confused about systemd-timesyncd

I used to get those interval/.../drift lines polluting my journal in an earlier version of systemd. In later versions those lines were no longer logged.
I'd hazard a guess that you need to enable a more verbose/debugging logging level to see them now.

Offline

#7 2016-12-03 17:21:11

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: [Solved] I'm somewhat confused about systemd-timesyncd

If that is true, perhaps the firewall modification was superfluous.  Let's wait to hear back from the OP.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#8 2016-12-03 19:43:49

ratcheer
Member
Registered: 2011-10-09
Posts: 912

Re: [Solved] I'm somewhat confused about systemd-timesyncd

Ok, I apologize, but once I got it working, I switched back to ntpd. The reason I had switched to timesyncd some months ago (maybe even more than a year) was that I couldn't get ntpd to work.

I did stop ntpd and turned timesyncd back on when I saw the above two posts. As ukhippo surmised, I am still getting only the single message about "Synchronized to time server..." However, I am still going back to ntpd, because it synchronizes more frequently than once per bootup.

Tim

Offline

#9 2016-12-03 20:25:46

ratcheer
Member
Registered: 2011-10-09
Posts: 912

Re: [Solved] I'm somewhat confused about systemd-timesyncd

I can see that by changing horses in the middle of the stream, I have made this thread into a hot mess. I really do apologize. I am just an old man trying to get my system working the way I want.

Mods, you may delete this thread if you want.

Tim

Offline

#10 2016-12-04 11:11:18

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,302

Re: [Solved] I'm somewhat confused about systemd-timesyncd

I want to share what I found about this matter.

The timestamp of '/var/lib/systemd/clock' is kept in the file system by a 'touch' on the file, not as a string in the file itself:

        /* if we got an authoritative time, store it in the file system */
        if (m->sync)
                (void) touch("/var/lib/systemd/clock");

Effectively the log level of some messages has changed since Feb 4, 2015: see
https://github.com/systemd/systemd/comm … b09a80427f
https://github.com/systemd/systemd/comm … 2c755fd2f4

Only log messages of info level are written in the journal.

The systemd-timesyncd program synchronizes more frequently than once per bootup too. You can see the last synchronization by:

$ ls -l /var/lib/systemd/clock  
-rw-r--r-- 1 systemd-timesync systemd-timesync 0  4 déc.  12:02 /var/lib/systemd/clock
déc. 04 10:54:52 arch64 systemd[1]: Starting Network Time Synchronization...
déc. 04 10:54:52 arch64 systemd[1]: Started Network Time Synchronization.

The normal interval is 2048s.

Last edited by berbae (2016-12-04 11:14:17)

Offline

#11 2016-12-04 11:20:01

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: [Solved] I'm somewhat confused about systemd-timesyncd

@berbae - Thanks for the digging.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#12 2016-12-04 13:28:31

ratcheer
Member
Registered: 2011-10-09
Posts: 912

Re: [Solved] I'm somewhat confused about systemd-timesyncd

@berbae - Yes, thank you.

Tim

Offline

Board footer

Powered by FluxBB