NTP Service not found, cannot configure time sync

My time clock has been drifting and I noticed that the settings in the web GUI for NTP Servers would not allow me to add any address saying it could not be reached. However, if I ping them from the shell, the ping is successful.

If I go into Shell:

root@serv[~]$ timedatectl  
               Local time: Tue 2024-05-21 05:52:43 EDT
           Universal time: Tue 2024-05-21 09:52:43 UTC
                 RTC time: Tue 2024-05-21 09:52:43
                Time zone: America/New_York (EDT, -0400)
System clock synchronized: no
              NTP service: active
          RTC in local TZ: no

I tried to run: sudo timedatectl set-ntp true
No changes.

root@serv[~]$ sudo systemctl enable ntpd   
Failed to enable unit: Unit file ntpd.service does not exist.
root@serv[~]$ sudo service ntpd start
Failed to start ntpd.service: Unit ntpd.service not found.
root@serv[~]$ sudo systemctl status systemd-timesyncd
Unit systemd-timesyncd.service could not be found.
root@serv[~]$ sudo service ntp restart
Failed to restart ntp.service: Unit ntp.service not found
root@serv[~]$ sudo ntpdate 
sudo: ntpdate: command not found
root@serv[~]$ sudo ntpd
sudo: ntpd: command not found
root@serv[~]$ sudo ntp 
sudo: ntp: command not found

I cannot run sudo apt-get ntpdate or anything like that since apt-get is disabled on truenas Im led to believe. What can I do to get timesync working again if the service and commands are not found?

This is a fairly recent Truenas SCALE install, nothing special on my end, Im fairly beginner at this and did nothing complex besides some datasets and VM install.

OS Version:TrueNAS-SCALE-23.10.2

We use chrony.

thanks. any ideas why it isn’t syncing? I’m unfamiliar with chrony. when I run sudo chronyd it says Another chronyd may already be running (pid=2562), check /run/chrony/chronyd.pid.

You can look at chronyc stats via cronyc sourcestats c.f. man chronyc

If there is excessive slew due to things like misconfiguring your bios to local time rather than UTC then ability to correct via NTP may be hamperred.

I suggest looking into the NTP200 and NTP250 from CenterClick. I once had my NAS go buckwild when its clock was out of sync. The NTP2xx are purpose-built, dead-simple appliances that just work. Excellent support from the developer in NH also.

Those are nice little devices (I have a 250), and presumably being on the local network would allow OP’s system to reach them. Or, of course, good router software like OPNsense or pfSense would provide NTP service to the LAN.

But if OP’s system is giving errors to the effect that hosts are unreachable, that points to an underlying network problem.

1 Like

Depends on where the NTP is, no?

I have read on this forum about ISPs blocking access to port 123 / NTP due to this being a potential DDOS attack vector. So that could be just as much the source of the problem as a misconfigured firewall, gateway, etc.

That would be a phenomenally stupid thing to do, but I wouldn’t put it past them. And yes, if that’s what’s going on, it would likely explain the errors OP has alluded to. I’d hope in that case the ISP would at least provide its own NTP server for its customers.

And if you’re already running pfSense (or can adapt this to OPNsense), it can be a lot less expensive to provide Stratum 1 NTP to your LAN:

h/t @elvisimprsntr

1 Like