You are not logged in.

#1 2012-07-08 03:50:39

RaisedFist
Member
From: Romania
Registered: 2007-01-30
Posts: 556
Website

ntpd problems with systemd

I switched to systemd for almost two weeks and I have problems with ntpd. It doesn't synchronize at all. Does anyone have this issue?

Offline

#2 2012-07-08 03:52:41

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

Re: ntpd problems with systemd

Force a sync to the hwclock after stopping ntpd and manually syncing via ntpdate.  Also delete your drift file.

Offline

#3 2012-07-08 07:24:49

89c51
Member
Registered: 2012-06-05
Posts: 741

Re: ntpd problems with systemd

anything weird in your /var/log/ntp.log??

Offline

#4 2012-07-08 08:28:22

andmars
Member
Registered: 2012-03-13
Posts: 910

Re: ntpd problems with systemd

Hi, I have a similar problem that the system starts with 2 hours ahead and after a couple of minutes it jumps back to the correct time.

So I stoped ntpd.service and did a:

ntpd -qg

plus a:

hwclock -w

now for the first time I have a:

 8 Jul 10:21:51 ntpd[8301]: ntpd: time set -7199.734050 s

line in my /var/log/ntp.log. Never before coudl I find a "time set" or "synched" or anything in that log file. Hopefully it works now. My ntp.log file looks like this: http://pastebin.com/JqTCBtHv

Last edited by andmars (2012-07-08 08:29:41)

Offline

#5 2012-07-08 08:29:08

vacant
Member
From: downstairs
Registered: 2004-11-05
Posts: 816

Re: ntpd problems with systemd

I used to have a problem on boot that ntpd just gave up when it tried the first time and the network hadn't yet connected. My solution was similar to graysky's, I ran ntpdate (added to my network "post connect" script). I switched to systemd and openntpd some time back and haven't had issues. /etc/confd/openntpd has

#  -s Set the time immediately at startup if the local clock is off by more than#  180 seconds.
PARAMS="-s"

which is reasonable.

Last edited by vacant (2012-07-08 08:31:03)

Offline

#6 2012-07-08 08:46:17

89c51
Member
Registered: 2012-06-05
Posts: 741

Re: ntpd problems with systemd

andmars wrote:

Hi, I have a similar problem that the system starts with 2 hours ahead and after a couple of minutes it jumps back to the correct time.

So I stoped ntpd.service and did a:

ntpd -qg

plus a:

hwclock -w

now for the first time I have a:

 8 Jul 10:21:51 ntpd[8301]: ntpd: time set -7199.734050 s

line in my /var/log/ntp.log. Never before coudl I find a "time set" or "synched" or anything in that log file. Hopefully it works now. My ntp.log file looks like this: http://pastebin.com/JqTCBtHv


Fuq

I just realized that i also don't have anything with "time set" or "synched" in my ntp.log

The time is correct and systemctl status ntpd.service gives me:

ntpd.service - Network Time Service
	  Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled)
	  Active: active (running) since Sun, 08 Jul 2012 10:14:13 +0300; 1h 29min ago
	 Process: 397 ExecStart=/usr/bin/ntpd $NTPD_ARGS -p /run/ntpd.pid (code=exited, status=0/SUCCESS)
	Main PID: 402 (ntpd)
	  CGroup: name=systemd:/system/ntpd.service
		  └ 402 /usr/bin/ntpd -g -u ntp -p /run/ntpd.pid

The time was wrong when i set up my system --didn't have ntp then- but i changed it through gnome and is ok now.

Any ideas?

Last edited by 89c51 (2012-07-08 08:53:12)

Offline

#7 2012-07-08 18:17:45

RaisedFist
Member
From: Romania
Registered: 2007-01-30
Posts: 556
Website

Re: ntpd problems with systemd

graysky wrote:

Force a sync to the hwclock after stopping ntpd and manually syncing via ntpdate.  Also delete your drift file.

Thanks. That worked just fine.

Offline

#8 2012-07-09 11:55:04

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,097

Re: ntpd problems with systemd

graysky wrote:

Force a sync to the hwclock after stopping ntpd and manually syncing via ntpdate.  Also delete your drift file.

ntpdate is deprecated and will be removed "soon", use ntpd -gq(insert as many g's as needed)  instead.


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#9 2012-07-09 14:02:14

89c51
Member
Registered: 2012-06-05
Posts: 741

Re: ntpd problems with systemd

Because i am curious on this. What is supposed to be in the ntp.log file.

I run ntpq -c readvar, ntpq -c peers (gentoo wiki) and my results seem ok. hmm

ntpq -c readvar
associd=0 status=0618 leap_none, sync_ntp, 1 event, no_sys_peer,
version="ntpd 4.2.6p5@1.2349-o Sat Jun  9 05:23:54 UTC 2012 (1)",
processor="x86_64", system="Linux/3.4.4-2-ARCH", leap=00, stratum=3,
precision=-23, rootdelay=74.872, rootdisp=88.725, refid=193.104.37.238,
reftime=d3a560d5.7a9a7a97  Mon, Jul  9 2012 16:53:25.478,
clock=d3a561a0.e46112c5  Mon, Jul  9 2012 16:56:48.892, peer=25209, tc=9,
mintc=3, offset=-3.226, frequency=-43.306, sys_jitter=1.970,
clk_jitter=2.715, clk_wander=0.935

ntpq -c peers
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*xen02.cblue.be  193.190.230.66   2 u  211  256  377   69.363   -1.949   0.468
+ks3094489.kimsu 195.220.94.163   2 u  195  256  377   66.565   -5.356   0.243
-s02.be.it2go.eu 193.190.230.65   2 u  226  256  377   86.106   10.771   1.173
+ntp2.exa-networ 195.66.241.3     2 u    7  256  377   64.494   -2.448   0.783

Also from systemctl i have.

ntpd.service                                                             loaded active running       Network Time Service
systemd-timedated-ntp.target                                             loaded active active        Network Time Protocol

Offline

Board footer

Powered by FluxBB