[SOLVED]systemd-timesyncd is not syncing time

This forum is for discussion about general software issues.

[SOLVED]systemd-timesyncd is not syncing time

Postby kotrfa » Mon Jun 09, 2014 7:16 am

SOLUTION HERE: https://bbs.archlinux.org/viewtopic.php?id=182600

Hello,
I tried to replace ntp with systemd-timesyncd. I disabled ntpd, enabled systemd-timesyncd, enabled and set systemd-networkd (I found that it might help) over netctl (which I could uninstall then). It somehow worked for few reboots, but then it stopped. Of course there must be a reason why, but I can't figure out what it could be. Everything looks fine to me, but time is just not syncing and I'm 30 minutes in the past (compared with realtime). It loads saved time (as fake-hwclock does), but then there is no sync.

Here are my logs:

~ $ systemctl status systemd-networkd systemd-timedated systemd-timesyncd
Code: Select all
* systemd-networkd.service - Network Service
   Loaded: loaded (/usr/lib/systemd/system/systemd-networkd.service; enabled)
   Active: active (running) since Sun 2014-06-08 16:48:36 CEST; 15h ago
     Docs: man:systemd-networkd.service(8)
 Main PID: 149 (systemd-network)
   Status: "Processing requests..."
   CGroup: /system.slice/systemd-networkd.service
           `-149 /usr/lib/systemd/systemd-networkd

Jun 08 16:48:36 smecpi systemd[1]: Starting Network Service...
Jun 08 16:48:36 smecpi systemd-networkd[149]:             eth0: link configured
Jun 08 16:48:36 smecpi systemd[1]: Started Network Service.
Jun 08 16:48:37 smecpi systemd-networkd[149]:             eth0: gained carrier

* systemd-timedated.service - Time & Date Service
   Loaded: loaded (/usr/lib/systemd/system/systemd-timedated.service; static)
   Active: active (running) since Mon 2014-06-09 08:14:05 CEST; 11min ago
     Docs: man:systemd-timedated.service(8)
           man:localtime(5)
           http://www.freedesktop.org/wiki/Software/systemd/timedated
 Main PID: 4520 (systemd-timedat)
   CGroup: /system.slice/systemd-timedated.service
           `-4520 /usr/lib/systemd/systemd-timedated

Jun 09 08:14:05 smecpi systemd[1]: Started Time & Date Service.

* systemd-timesyncd.service - Network Time Synchronization
   Loaded: loaded (/usr/lib/systemd/system/systemd-timesyncd.service; enabled)
   Active: active (running) since Sun 2014-06-08 16:48:35 CEST; 15h ago
     Docs: man:systemd-timesyncd.service(8)
 Main PID: 125 (systemd-timesyn)
   CGroup: /system.slice/systemd-timesyncd.service
           `-125 /usr/lib/systemd/systemd-timesyncd

Jan 01 01:00:06 smecpi systemd-timesyncd[125]: System clock time unset or jumped backwards, restoring from recorded timestamp: Sun 2014-06-08 16:48:35 CEST
Jun 08 16:48:35 smecpi systemd[1]: Started Network Time Synchronization.


~ $ timedatectl
Code: Select all
      Local time: Mon 2014-06-09 08:29:51 CEST
  Universal time: Mon 2014-06-09 06:29:51 UTC
        RTC time: n/a
       Time zone: Europe/Prague (CEST, +0200)
     NTP enabled: yes
NTP synchronized: no
 RTC in local TZ: no
      DST active: yes
 Last DST change: DST began at
                  Sun 2014-03-30 01:59:59 CET
                  Sun 2014-03-30 03:00:00 CEST
 Next DST change: DST ends (the clock jumps one hour backwards) at
                  Sun 2014-10-26 02:59:59 CEST
                  Sun 2014-10-26 02:00:00 CET


Submitted as a bug: https://bugs.freedesktop.org/show_bug.cgi?id=79836


Any ideas?
Last edited by kotrfa on Wed Jun 11, 2014 6:59 pm, edited 1 time in total.
kotrfa
 
Posts: 7
Joined: Fri Jun 06, 2014 8:14 pm

Re: systemd-timesyncd is not syncing time

Postby kotrfa » Wed Jun 11, 2014 4:11 pm

So I found a "solution".

The problem is that timesyncd does not detect "network change" for which it waits. So when I boot up and I have timesyncd and networkd enabled, timesyncd just shows
Code: Select all
systemd[1]: Started Network Time Synchronization." 


The solution is simple, you just have to restart networkd using
Code: Select all
 systemctl restart systemd-networkd


then timesyncd catches up and will show something like this:

Code: Select all
Network configuration changed, trying to establish connection.


I guess the problem is that networkd starts earlier then timesyncd and timesyncd waits for change.
kotrfa
 
Posts: 7
Joined: Fri Jun 06, 2014 8:14 pm


Return to General

Who is online

Users browsing this forum: No registered users and 2 guests

cron