perfsonar / owamp

A tool for performing one-way or two-way active measurements
Apache License 2.0
70 stars 30 forks source link

NTP: STA_NANO should be set. #34

Closed teto closed 6 years ago

teto commented 6 years ago

Trying to package owamp for my distrib as I need to use it. It seems that it only supports ntpd since on start I have:

owampd[13526]: NTP: STA_NANO should be set. Make sure ntpd is running, and your NTP configuration is good.
owampd[13526]: WARNING: No limits specified.

I got openntpd running

journalctl -b0 -u openntpd.service                                                                                  ~
-- Logs begin at Wed 2018-04-11 11:26:27 JST, end at Tue 2018-06-05 19:08:57 JST. --
juin 04 11:07:48 jedha systemd[1]: Starting OpenNTP Server...
juin 04 11:07:48 jedha systemd[1]: Started OpenNTP Server.
juin 04 11:09:30 jedha ntpd[825]: adjusting local clock by 0.105581s
juin 04 11:36:57 jedha ntpd[825]: adjusting clock frequency by -0.081088 to -5.161075ppm
juin 04 11:55:14 jedha ntpd[825]: adjusting clock frequency by 0.230329 to -4.930743ppm
juin 04 12:18:30 jedha ntpd[825]: adjusting clock frequency by 7.975857 to 3.045117ppm
juin 04 18:24:51 jedha ntpd[825]: adjusting local clock by -0.105603s
juin 04 18:51:20 jedha ntpd[825]: adjusting local clock by -0.088183s
juin 04 18:51:53 jedha ntpd[825]: adjusting local clock by -0.071683s
juin 04 23:24:17 jedha ntpd[825]: adjusting local clock by -0.063756s
juin 05 02:03:22 jedha ntpd[825]: adjusting local clock by -0.037993s
juin 05 02:19:30 jedha ntpd[825]: adjusting local clock by -0.040908s
juin 05 05:27:50 jedha ntpd[825]: adjusting local clock by -0.057288s
juin 05 09:46:20 jedha ntpd[825]: adjusting local clock by -0.067621s
juin 05 11:25:15 jedha ntpd[825]: adjusting clock frequency by -12.128926 to -9.083928ppm
juin 05 16:33:40 jedha ntpd[825]: adjusting clock frequency by 2.696960 to -6.386963ppm

is there any configure flag/hack I could use to bypass this check ? I guess it shouldn't be too hard to replace openntpd with legacy ntpd but if I could work around it that would be cool.

Thanks for the great tool.

mfeit-internet2 commented 6 years ago

As shipped, the check for NTP is hard-wired into the code and isn't configurable. Making it configurable with a command-line switch wouldn't be difficult.

The obvious hack (and you'd be on your own with this) is to build a version of owampd without the check. The danger is that if time sync is lost and the clock starts to drift, OWAMP will come up with wrong answers and the client will be none the wiser. I'd have to go check the RFC for the OWAMP protocol to see if there's anything that lets the server signal the client that its clock isn't in sync.

teto commented 6 years ago

I thought this was fatal to the server as it died afterwards without any other message. After an strace, I managed to get a working systemd service and packaged the program for nixos https://github.com/NixOS/nixpkgs/pull/41485 .

Thanks for the great soft.

ShawnMcKee commented 7 months ago

Hi Mark, this is still an issue on 5.0.7. I guess for supporting chronyd and eventually ptpd, there will need to be a fix? I currently can't get a demo to work using the docker testpoint. I made sure the host system has ntpd running and I still get: owping returned an error: owping: ntp_adjtime(): Operation not permitted;owping: NTP: STA_NANO should be set. Make sure ntpd is running, and your NTP configuration is good.;owping: ntp_adjtime(): Thanks, Shawn

mfeit-internet2 commented 7 months ago

@ShawnMcKee At some point, we're going to have to reckon with getting this implementation of OWAMP untied from NTP and smart enough to figure out sync on systems using other methods. Probably sooner rather than later since perfSONAR is moving away from distributions that run NTP.