network time sync problem

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
Aidan Hedley
Posts: 9
Joined: Tue Sep 08, 2015 3:58 pm

network time sync problem

Post by Aidan Hedley »

Hi,
I am running a new build (yesterday) with option 4 (daemon) for network time sync
The network time servers do not appear to be updating - hope you can help.
root@Diet_WiPi:~# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
service0-eth4.d .INIT. 16 u - 64 0 0.000 0.000 0.000
beastie.deuza.n .INIT. 16 u - 64 0 0.000 0.000 0.000
ntp.wide-net.pl .INIT. 16 u - 64 0 0.000 0.000 0.000
sircabirus.von- .INIT. 16 u - 64 0 0.000 0.000 0.000
root@Diet_WiPi:~# ^C
root@Diet_WiPi:~# date
Sat 16 Apr 16:11:02 BST 2016
root@Diet_WiPi:~#
I don't need to open ports in my router do I ?
User avatar
Fourdee
Site Admin
Posts: 2788
Joined: Tue Feb 06, 2007 1:36 pm

Re: network time sync problem

Post by Fourdee »

Hi,

Might be worth trying the built in systemD ntp:

Code: Select all

systemctl unmask systemd-timesyncd
systemctl enable systemd-timesyncd
apt-get purge ntp -y
apt-get autoremove --purge -y
reboot
You can then check the status of timesyncd with:

Code: Select all

timedatectl status
Give it some time to sync, then it should return this:

Code: Select all

root@DietPi-XU4:~# timedatectl status
      Local time: Thu 2016-06-23 20:35:23 BST
  Universal time: Thu 2016-06-23 19:35:23 UTC
        RTC time: Thu 2016-06-23 19:35:23
       Time zone: Europe/London (BST, +0100)
     NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no
      DST active: yes
 Last DST change: DST began at
                  Sun 2016-03-27 00:59:59 GMT
                  Sun 2016-03-27 02:00:00 BST
 Next DST change: DST ends (the clock jumps one hour backwards) at
                  Sun 2016-10-30 01:59:59 BST
                  Sun 2016-10-30 01:00:00 GMT
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
Aidan Hedley
Posts: 9
Joined: Tue Sep 08, 2015 3:58 pm

Re: network time sync problem

Post by Aidan Hedley »

Took me a while to return to this problem.
Thanks, a good solution All sorted. :-)
Why would it affect 3/3 of my recent builds?
User avatar
Fourdee
Site Admin
Posts: 2788
Joined: Tue Feb 06, 2007 1:36 pm

Re: network time sync problem

Post by Fourdee »

Aidan Hedley wrote:Why would it affect 3/3 of my recent builds?
Not sure, but most likely an issue with your internal network.

The only thing i can suggest is check the log file for any errors (probably should of done this 1st, but nevermind :) ):

Code: Select all

killall -w ntpd
ntpd
sleep 5
cat /var/log/ntpd.log
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
Post Reply