Giter Club home page Giter Club logo

sntpd's Issues

Use IPV4 if IPV6 is present and disabled.

When booting a Linux system with the kernel command line option:
ipv6.disable=1 the IPV6 kernel module will be loaded but administratively disabled.
If I try to use ntpclient 2017.246 on such a system to set the time and exit:
ntpclient -dstvn pool.ntp.org
I get
ERROR - Failed creating UDP socket() to SNTP server: Address family not supported by protocol
Booting without this option eliminates the issue.

same argument for o1 and o2

In rate.awk FNR is used to read only one record. o1 and o2 has same argument $5.For same record argument will be the same .slop is using calculation o1 subtracting from o2 .It will be always zero.

compatibility with upstream and usermode

I'm using ntpclient to monitor the clock offset of a bunch of machines.

With the original ntpclient version, I could easily get this information (root or not):

root$ ntpclient -c1 -h pool.ntp.org
43441 60350.979    1963.0      5.9     890.3  21179.2     11344

In troglobit's fork, '-h' was changed to mean 'help' and the output goes to stderr (why?) so I have to adjust a few flags and redirect the output to stdout. It broke out of the box compatibility with the old version, but so far I can still live with that (as non root):

nobody$ ntpclient -c1 pool.ntp.org 2>&1
43441 58627.120    2270.0      8.3      27.8  63232.4     66222

Now the problem arises when I want to do the same thing as root. First, I need to disable daemon mode, which is enabled by default for root ๐Ÿ˜ž. However, this still does not work! When running as root, the output is disabled and I need to enable debug mode to see anything (which also adds other unwanted messages):

root$ ntpclient -c1 -n -d pool.ntp.org 2>&1
packet of length 48 received
43441 59793.248    2063.0     34.0    5109.1  42770.4     -4915

To make it worse, the only way I could find this was by looking at the code:

https://github.com/troglobit/ntpclient/blob/435e52063a863e1b1ef0463f78cb1b156cd1bd00/src/ntpclient.c#L477-L483

That being said, I have two suggestions to solve this:

TL;DR: this fork adds a daemon mode to ntpclient, but almost breaks its original purpose. It would be good to not assume behaviour based on the EUID or to at least introduce a 'usermode' flag.

I don't mind preparing a pull request after getting some feedback on this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.