troglobit / sntpd Goto Github PK
View Code? Open in Web Editor NEWsntpd is a fork of Larry Doolittle's ntpclient with added daemon, syslog, and IPv6 support
License: GNU General Public License v2.0
sntpd is a fork of Larry Doolittle's ntpclient with added daemon, syslog, and IPv6 support
License: GNU General Public License v2.0
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.
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.
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:
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.