Hi,
Folowing this guide of Jekyll: https://nguvu.org/pfsense/network%20time%20protocol%20(ntp)/ntp-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.
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
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 ?
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.
well the topic is more than 2 years old and we never got feedback from OP. So we don’t know
sorry for my late reply. I Got this working in the end, but I had tried so many different things that I did not know what made it work.
At least I remember making a fresh install and follow jus a part of the nguvu-guide… (less is more… ) when it finally worked.
The plan was actually to see it running for a while… and then make a reply, which I had forgotten.
In the end is was and is a stable stratum-1 server.
At this moment I am looking tot upgrade from Debian strech to bullseye … and I fear I might break the NTP-server.
Any Advise?
well do a backup/image clone of your system and give it a try
That was what I was thinking. It probably the most easy way is to clone with Clonezilla to a share on my NAS. I will look in to that.