Problem with NTP server on Odroid C2

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
Dietuser66
Posts: 2
Joined: Wed Mar 20, 2019 11:14 am

Problem with NTP server on Odroid C2

Post by Dietuser66 »

Hi,

Folowing this guide of Jekyll: https://nguvu.org/pfsense/network%20tim ... tp-server/ I try to build a small NTP-server on a Odroid-C2 running DietPi v6.21.1 | Odroid C2 (aarch64) ). I am able to receive the time from the GPS-system via a connected gps-module/antenna but somehowe I am not able to get the NTP-configuration working: I get this output:
root@NTP-C2:~# ntpq --version
ntpq 4.2.8p13@1.3847 Thu 14 Mar 19:33:39 UTC 2019 (1)
root@NTP-C2:~# ntpq -p
Servname not supported for ai_socktype
root@NTP-C2:~# update-leap -f
Can't locate IO/Socket/SSL.pm in @INC (you may need to install the IO::Socket::SSL module) (@INC contains: /etc/perl /usr/local/lib/aarch64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/aarch64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/aarch64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/aarch64-linux-gnu/perl-base) at /usr/sbin/update-leap line 31.
BEGIN failed--compilation aborted at /usr/sbin/update-leap line 31.
root@NTP-C2:~#
It seems the NTP installation was succesful (see output ntpq --version) , but [ntpq -p] and [update-leap -f] fail… i am also not sure if these failures are connected to eachother…

any ideas to get this working are welcome.
DietPi v6.21.1 running on Odroid C2 (aarch64), PI PoE Switch HAT, PI+ GPS-Expansionboard (Uputronics)
User avatar
MichaIng
Site Admin
Posts: 2421
Joined: Sat Nov 18, 2017 6:21 pm

Re: Problem with NTP server on Odroid C2

Post by MichaIng »

Hmm the guide is not too up-to-date and why ever builds NTP from source and creates a manual init.d service instead of systemd unit which I would always recommend.

Not sure if you have a backup to revert to fresh DietPi install, right before you started with this guide. What I would do is simply installing the ntp package from the Debian APT repo. There have not been any version steps for a longer time, the version are all the same: 4.2.8
apt install ntp
This assures that all dependencies are installed, system configuration steps are done and a systemd unit (service) is included. And you are sure that the configuration works with the other system parts/packages. Source build would require to do all these steps and configurations manually (which is why the guide is so large) and you are never 100% sure if some updates perhaps include changes that require different configurations and such.

If you have no backup or such, what I found about this error, could you check:
grep 'ntp' /etc/services
If this gives no output add:
echo -e 'ntp 123/tcp\nntp 123/udp' >> /etc/services
Dietuser66
Posts: 2
Joined: Wed Mar 20, 2019 11:14 am

Re: Problem with NTP server on Odroid C2

Post by Dietuser66 »

Thx for the input! The Odroids C2 sole funtion is time-server... so a fresh install won't be a big problem.
However I tried your lines first, after this: [Update-leap -f] still gives the same error.
[ntpq -p] now give: "connection refused"
root@NTP-C2:~# update-leap -F
Can't locate IO/Socket/SSL.pm in @INC (you may need to install the IO::Socket::SSL module) (@INC contains: /etc/perl /usr/local/lib/aarch64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/aarch64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/aarch64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/aarch64-linux-gnu/perl-base) at /usr/sbin/update-leap line 31.
BEGIN failed--compilation aborted at /usr/sbin/update-leap line 31.
root@NTP-C2:~# ntpq -p
ntpq: read: Connection refused
root@NTP-C2:~#

When I perform a fresh install of DietPi and perform [apt install ntp] which part of the guide from Jekyll do I still have to aply.... or is it just that ?
DietPi v6.21.1 running on Odroid C2 (aarch64), PI PoE Switch HAT, PI+ GPS-Expansionboard (Uputronics)
User avatar
MichaIng
Site Admin
Posts: 2421
Joined: Sat Nov 18, 2017 6:21 pm

Re: Problem with NTP server on Odroid C2

Post by MichaIng »

The steps that you should skip are at least:
- NTP installation (this is done via ATP now)
- Create folder for NTP statistics & drift files (is included in the APT package)
- Create NTP service handler (this is included in the APT package)

And do not run:
rm /etc/ntp.conf
rm /var/lib/ntp/ntp.conf.dhcp

Instead to have a backup to compare with original configuration:
mv /etc/ntp.conf /etc/ntp.conf_bak
mv /var/lib/ntp/ntp.conf.dhcp /var/lib/ntp/ntp.conf.dhcp_bak


Actually I think NTP can be used as server directly without any modifications. So you could try to skip the Create NTP configuration completely first and test/verify server functionality+client connections directly. If indeed the NTP daemon does not yet allow connections and works as server, then do the configuration steps.
Post Reply