ntp systemd-timesyncd issue

Having issues with your DietPi installation, or, found a bug? Post it here.
IamxHM
Posts: 6
Joined: Thu Nov 29, 2018 5:23 am

ntp systemd-timesyncd issue

Post by IamxHM »

I'm not very familiar with raspberry pi and its commands. I'm facing a issue in my dietpi installed raspberry pi. Whenever I type 'dietpi-software' (to install/uninstall softwares), I get 'waiting for completion of systemd-timesyncd' multiple times then I get the error 'Network time sync has not yet completed, or, failed to update'.
I have seen this earlier issue which I think I was solved by this commit, but still I'm not able to understand how to solve mine.
After boot it shows correct date time, I have checked that.

Code: Select all

root@DietPi:~# dietpi-software
[  OK  ] DietPi-Software | Root access verified.
[  OK  ] DietPi-Software | RootFS R/W access verified.

[  OK  ] DietPi-Software | Initialized database
[  OK  ] DietPi-Software | Reading database
[  OK  ] DietPi-Software | Connection test: http://raspbian.raspberrypi.org/raspbian
[  OK  ] DietPi-Run_ntpd | systemctl restart systemd-timesyncd
[ INFO ] DietPi-Run_ntpd | NTPD: Waiting for completion of systemd-timesyncd (1/60)
[ INFO ] DietPi-Run_ntpd | NTPD: Waiting for completion of systemd-timesyncd (2/60)
...{lines removed to shorten the output for this post}
[ INFO ] DietPi-Run_ntpd | NTPD: Waiting for completion of systemd-timesyncd (44/60)
Image
User avatar
WarHawk
Posts: 610
Joined: Thu Jul 20, 2017 8:55 am

Re: ntp systemd-timesyncd issue

Post by WarHawk »

Change your NTP mirror to pool.ntp.org

It will automatically and randomly grab the lowest latency ntp server from a HUGE pool of global NTP servers...

in case you didn't know
https://www.pool.ntp.org/en/
The pool.ntp.org project is a big virtual cluster of timeservers providing reliable easy to use NTP service for millions of clients.

The pool is being used by millions or tens of millions of systems around the world. It's the default "time server" for most of the major Linux distributions and many networked appliances (see information for vendors).

Because of the large number of users we are in need of more servers. If you have a server with a static IP address always available on the internet, please consider adding it to the system.

The project is maintained and developed by Ask Bjørn Hansen and a great group of contributors on the mailing lists. The source code for the system is available.

Hosting and bandwidth for the "hub" servers are provided by Develooper and Phyber Communications.
https://www.ntppool.org/en/use.html
IamxHM
Posts: 6
Joined: Thu Nov 29, 2018 5:23 am

Re: ntp systemd-timesyncd issue

Post by IamxHM »

I have tried this, it again does this:

Code: Select all

[  OK  ] DietPi-Run_ntpd | systemctl restart systemd-timesyncd
[ INFO ] DietPi-Run_ntpd | NTPD: Waiting for completion of systemd-timesyncd (1/60)
[ INFO ] DietPi-Run_ntpd | NTPD: Waiting for completion of systemd-timesyncd (2/60)
Edit: After selecting the new mirror, it tries to sync time (i think) and gives above mentioned errors again. Then goes back to couldn't sync thing as shown in the image in original post.
User avatar
WarHawk
Posts: 610
Joined: Thu Jul 20, 2017 8:55 am

Re: ntp systemd-timesyncd issue

Post by WarHawk »

Is your network and/or DNS server config setup correctly?

Can your system ping out to the internet?
IamxHM
Posts: 6
Joined: Thu Nov 29, 2018 5:23 am

Re: ntp systemd-timesyncd issue

Post by IamxHM »

I believe because I was using SSH in LAN to control the pi and my mobile had internet access. But still I'll try to ping internet website from my pi today and will let you know here.
User avatar
MichaIng
Site Admin
Posts: 2294
Joined: Sat Nov 18, 2017 6:21 pm

Re: ntp systemd-timesyncd issue

Post by MichaIng »

Please show status of the service: systemctl status systemd-timesyncd
IamxHM
Posts: 6
Joined: Thu Nov 29, 2018 5:23 am

Re: ntp systemd-timesyncd issue

Post by IamxHM »

Hello my internet is working fine in the pi. I tried this 'systemctl status systemd-timesyncd' and here's the output I got:

Code: Select all

root@DietPi:~# sudo systemctl status systemd-timesyncd
● systemd-timesyncd.service - Network Time Synchronization
Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; disabled; vendor preset: enabled)
Drop-In: /lib/systemd/system/systemd-timesyncd.service.d
└─disable-with-time-daemon.conf
Active: inactive (dead)
Docs: man:systemd-timesyncd.service(8)
IamxHM
Posts: 6
Joined: Thu Nov 29, 2018 5:23 am

Re: ntp systemd-timesyncd issue

Post by IamxHM »

I happened to see this, which says ntp service may be is conflicting with the timesyncd. So I commented few condition lines in timesyncd config and it worked. The website further says to purge the ntp. Should I do that?
User avatar
MichaIng
Site Admin
Posts: 2294
Joined: Sat Nov 18, 2017 6:21 pm

Re: ntp systemd-timesyncd issue

Post by MichaIng »

Hmm no status logs at the end?

Try: systemctl start systemd-timesyncd
They wait for some seconds and repeat: systemctl status timesyncd
User avatar
MichaIng
Site Admin
Posts: 2294
Joined: Sat Nov 18, 2017 6:21 pm

Re: ntp systemd-timesyncd issue

Post by MichaIng »

Ah did you install the ntp package?

In this case open dietpi-config > Advanced Options and choose "none/custom" as time sync mode.

This will lead to DietPi relying on correct time due to non systemd time sync daemons.

But if you don't need very exact system time, usually I would recommend to stay with systemd and purge any 3rd party time sync systems: apt purge ntp
Post Reply