henning
a4d68a0292
with usig the meadian offset froma number of measurements the recording
of the last sensor update time got broken, doesn't show up with gps since
it updates often (more often than we read), but naddy ran into it with dcf.
record time of last sensor datum seperately. ok naddy balmer
18 years ago
henning
4f07972cbe
use clock_gettime(CLOCK_MONOTONIC, ..) to get a monotonically increasing
time, and make ntpd use that to send the next uery to an ntp peer and the
like. this has the advantage that changes to the clock do not interfere
with the intervals. for example, when we start on machines without an
RTC and the initial settime (-s) kicks in, intervals were strange.
idea from amandal@entrisphere.com, this implementation by me
tested ckuethe, phessler, mbalmer, ok mbalmer
18 years ago
henning
f5c6db18a7
timedelta sensors are usually updated very often, but we used to query
them only every 30 seconds. now query them every 5,and take the median
value from 7 queries as sensor value. this takes outliers out of the
equation and makes the overall result much better, especially for
sensors with heavy jitter (like nmea for now)
18 years ago
henning
9e886819ac
in client_nextaddr, check fd != -1 before close, just nicer this way
From: amandal@entrisphere.com
18 years ago
henning
431920cccf
Found that even if client fd (i.e to NTP source) is set to
-1 because of error, it may still participate in poll()
causing poll() to repeatedly wake up on error fd.
so make sure w edon't add -1 fds to pollevents to avoid unnecessary wakeups
From: amandal@entrisphere.com
18 years ago
henning
43bb2c0b5f
when ntp_sendmsg fails, reset trustlevel to TRUSTLEVEL_PATHETIC
From: amandal@entrisphere.com
18 years ago
henning
8031d5c7e5
EADDRNOTAVAIL after connect is one of the soft errors where we don't abort
too. from amandal@entrisphere.com
18 years ago
henning
153642fa72
need to call adjtime once in a while here too, otherwise sensor-only
servers never update the system clock
18 years ago
henning
988040972e
internally, ntpd doesn't work with absolute offsets to system time, but
takes the offset it adjtime() is already correcting for into account
when taking the offset from a sensor, we need to correct it by the
offset between system time and ntpd view.
18 years ago
stevesk
70c89238ab
use 'weight-value' vs. 'offset' for the weight argument;
ok jmc@ henning@
18 years ago
deraadt
bcbd2043ec
strtonum() with INT_MAX intead of LONG_MAX, problem pointed out by pierre-yves@spootnik.org
18 years ago
henning
031b227392
make sure updates from sensors have the "synced" flag set
18 years ago
otto
b10a9a26fe
remove some unneeded includes; one found by vetinari
18 years ago
deraadt
9801d84234
spaces
18 years ago
otto
7c32f0a09d
don't write anything to log until we are daemonized. spotted by
david@; ok henning@
18 years ago
otto
45a03a18d6
increase polling intervbal, but only after we are synced and have done
a few frequency adjustments. ok henning@
18 years ago
otto
2e46737551
Reset adjtime() on startup; having an adjtime() active while starting
up causes overcompensation and confusing debug log entries; noticed
by dtucker@
18 years ago
otto
68bc275e60
Document /var/db/ntpd.drift; ok jmc@
18 years ago
otto
041bde21e5
Save the computed clock drift and use it on startup. ok deraadt@
henning@
18 years ago
otto
8746f65b53
avoid a race by installing SIGCHLD handler before fork() is called.
ok henning@ ckuethe@
18 years ago
otto
086410730e
tsk, tsk, tsk... the rule is simple: any define consisting of
more than one token MUST be put in parentheses!
18 years ago
otto
abf6b82fcd
Import frequency conrrection code from dragonfly, whith some changes:
only do frequency compensation if the clock is synced, and a slightly
diffent way of computing the linear regression.
You'll need a recent kernel and libc to use this.
Testing by naddy@ and ckuethe@ and others, thanks!
ok henning@
18 years ago
otto
c01a2e9569
set session id and init logging in -s mode. tested by david@ and matthieu@;
ok henning@
18 years ago
otto
24133ce79c
simplify; ok henning@
18 years ago
otto
89f43414db
Compensate old offsets with the amount of adjustment done, avoiding
overcompensating. From DragonFly, uses recent adjtime(2) changes,
so you'll need a recent kernel. ok henning@
18 years ago
otto
24fa8ea878
Only invalidate stored replies if an adjustment was really made.
ok henning@
18 years ago
henning
9be86cfc22
just ise "HARD" as refid with sensors for v3 clients
18 years ago
henning
216ee11434
incredibly stupid typo
18 years ago
otto
fc47aa1fcc
even though the bounds are long long having an upper bound of
ULONG_MAX does not work; the max upper bound is LONG_MAX,
since LONG_MAX == LLONG_MAX on 64bit archs. ok deraadt@ henning@
18 years ago
otto
5ca49f4a5e
When expanding servers, do not forget to copy weight. ok henning@
18 years ago
henning
1110d359db
urgs, other stuff snuck in
18 years ago
henning
5a53deb317
do not use /dev/hotplug for now, only one reader supported yet
18 years ago
henning
baf806507d
put back regular sensors scanning
18 years ago
henning
eea91760ae
only actually run sensor_query when it is due, not every time poll returns
18 years ago
ckuethe
9325c20f99
When ntpd backs off polling due to a negative delay, tell the user how long
it will wait until the next poll.
ok henning@
18 years ago
jmc
0d1cb4cfe1
better wording for the "weight" section;
18 years ago
jmc
146a76e0cb
document the optional "weight" keyword, and a little cleanup;
from henning and myself
18 years ago
henning
d4fd11008a
when we cannot open /dev/hotplug, donn't bail, just work without
with ckuethe
18 years ago
henning
52daf64bf5
allow for weight to be added to sensors or servers, so that one can
weight timedelta sensors higher than ntp peers, for example
ok deraadt mbalmer
18 years ago
henning
24755fb155
get clock src id from the timedelta sensor desc.
unfortunately I still don't have any hardware to test this ;(
18 years ago
henning
60325542b8
if sysctl gives ENOENT the sensor is gone and we remove it
18 years ago
henning
b2a25c5f18
let sensor_query handle removals itself
18 years ago
henning
1314afba48
sensor_byid not needed any more
18 years ago
henning
18724bbfff
hotplug devid will go away in a minute, so don't use it here any longer
18 years ago
henning
494460017f
do not bother with rmeoval events, we remove sensors whoch vanished or
are not a timedelta sensor any more on query on the fly anyway
18 years ago
jmc
405e658006
small grammar improvement;
18 years ago
henning
d5fece7cde
DV_SENSORS is no more, plug workaround for the time to the real solution
18 years ago
henning
790a2f0010
make use of the new hotplug events for sensors showing up or vanishing
18 years ago
henning
54fb320578
add sensor_byid(), return sensor by its id
18 years ago
henning
d3875817fc
stop passing the config around all time, just store one copy
18 years ago