bcook
e69bd15d31
sync log.c from smtpd.
Reduces the number of log.c snowflakes by a little, and gives ntpd a
variadic fatal() function to be used later.
ok deraadt@
10 years ago
bcook
2b0bc47767
rename sockaddr_un variables from 'sun' to the more common 'sa'.
This avoids a namespace conflict with Solaris build environments.
discussed with deraadt@ and kettenis@
10 years ago
bcook
d33f0cc042
Add a missing include for time.h to get the definitions of clock_gettime and strftime.
ok jsing@ phessler@ naddy@
10 years ago
dtucker
c438f027ad
Run the serving and privileged ntpd processes at high priority and the
dns process at normal priority. Should improve latency on loaded machines.
ok henning@
11 years ago
sthen
8b3ce8e88e
typo in errx() string
11 years ago
benno
a6df84bdf5
allow -s<abrev> in addition to -s <word> in ntpctl commandline, like
all the other tools do. changes option 'sensors' to 'Sensors'.
ok henning@, and grudgingly phessler@
11 years ago
deraadt
5d614be5df
improve ntpctl usage so that the manual page does not need to be read
every time
ok jmc
11 years ago
benno
b7644de136
from sthen: handle msgbuf_write() returning EAGAIN
ok krw
11 years ago
jmc
1ceaa18b3a
tidy up the "modifier" list a little and sync usage();
NB: this utility has only one option, and it's not optional! i haven;t
marked -s as being mandatory, since hopefully someone will make
ntpctl run without arguments do something useful;
11 years ago
deraadt
27354bc9e5
improve ntpctl argv parsing
11 years ago
deraadt
cfa24d6ccc
shorten output; ok henning phessler
11 years ago
schwarze
c595a4fa35
Tweak previous:
* For time_t values, use the printf("%lld", (long long)t) idiom.
* Don't print "Invalid program name" in usage() when main() just runs ntpd.
* Make "Show/Shows" consistent in the manual, sort .Xr and correct .Ox.
OK phessler@
11 years ago
phessler
36ee6e401f
Add ntpctl(8), which allows us to query the locally running ntpd(8) process
diff from Mike Miller <mmiller mgm51 com> (many thanks!)
OK phessler@, henning@, todd@
11 years ago
okan
59189da029
use timerclear macro
ok henning@
14 years ago
eric
6f6b8fa1fb
don't need to setup the resolver early now that dns lookups are done
by the dns engine.
ok henning@
15 years ago
nicm
62564ff79f
Rename some imsg bits to make namespace collisions less likely buf to
ibuf, buf_read to ibuf_read, READ_BUF_SIZE to IBUF_READ_SIZE.
ok henning gilles claudio jacekm deraadt
15 years ago
pyr
239fd25471
make ntpd imsg-in-a-lib ready as well. extensive testing done, no
behavior change.
ok eric@
16 years ago
henning
847353da0b
no we don't need endpwent
i remember we already had the confusion and bgpd doesn't have the endpwent
16 years ago
stevesk
75af6f507d
log tiny frequency adjustments at debug only.
ok henning@, 'I think I agree' otto@
16 years ago
stevesk
d48f49351f
rename a #define to be clearer; no binary change
ok henning@
16 years ago
stevesk
5e5980c0aa
log warning when can't read drift file; allows detection of
corrupt contents. ok henning@
16 years ago
claudio
3024525a7d
Use errx instead of fprintf, exit combo.
Diff from Gleydson Soares gsoares (at) gmail (dot) com
OK henning@
16 years ago
ckuethe
51e14636f6
Allow ntpd to step the time at startup, now matter how large or small the
offset. The 180s limit doesn't help very much these days.
ok otto@ mbalmer@
17 years ago
pyr
69c0857e6a
ntpd missed the argument check sweep.
17 years ago
henning
3020799cfb
we must reset the poll timeout to INFTIM when receiving the IMSG_SETTIME
because otherwise the poll timeout will stay at SETTIME_TIMEOUT (15s)
forever unless we time out waiting for the first reply with -s
spotted by Aaron Riekenberg <aaron.riekenberg@gmail.com>
17 years ago
stevesk
f0b6a351e5
log a warning one time when we can't open or write the drift file;
also add "(no drift file)" to the adjfreq log message on failure;
ok henning@
17 years ago
stevesk
55917fac67
just call getpwnam(NTPD_USER) once; ok henning@
17 years ago
fgsch
6cdd0c813d
revert SIGQUIT catching; requested by deraadt
17 years ago
fgsch
5d7a07e45a
catch SIGQUIT too. ckuethe@ and henning@ ok.
17 years ago
otto
40598298ed
if the drift file is missing, reset adjfreq to zero; iirc diff from Glaser
from a long time ago. ok ckuethe@
17 years ago
jmc
121bce7837
add -n to usage();
17 years ago
pyr
90f5650e4c
Provide the -n switch like in the other imsg daemons for testing
the configuration file.
"yes please, ok" henning@
17 years ago
ckuethe
05c8b9ebe9
Allow ntpd to log sensor offsets and adjtime calls to syslog at LOG_DEBUG
priority.
ok gwk, mbalmer, weingart
"explicit non-ok from" henning
17 years ago
otto
1f8bd32eb8
Although Unix compilers accept more than one definition of a global
symbol, follow the guidelines from K&R: only one definition of a
global symbol (and possibly more declarations). Rename some vars
here and there to avoid shadowing. ok henning@
18 years ago
deraadt
9801d84234
spaces
19 years ago
otto
7c32f0a09d
don't write anything to log until we are daemonized. spotted by
david@; ok henning@
19 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@
19 years ago
otto
041bde21e5
Save the computed clock drift and use it on startup. ok deraadt@
henning@
19 years ago
otto
8746f65b53
avoid a race by installing SIGCHLD handler before fork() is called.
ok henning@ ckuethe@
19 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@
19 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@
19 years ago
stevesk
b020f35b9f
handle -1 return from host_dns(); ok henning@
19 years ago
wvdputte
33dc34f1c7
when running ntpd with "-s" as it's argument from /etc/rc.conf, make sure the
output goes to syslog and not console by moving around log_init
OK henning@, markus@ and mblamer@
19 years ago
dtucker
98e724b50a
More descriptive error if a signal causes the child to exit; ok henning@
20 years ago
henning
a16f15c2c3
use a #define for the time to wait on -s and clarify a log msg
20 years ago
henning
ed37b625d3
use a little state engine to keep track of delayed dns lookups and such,
eases things
tested by Jason Ackley <jason@ackley.net> Matthias Kilian
<kili@outback.escape.de> Stephen Marley <stephen@marley.org.uk> sturm@
theo ok
20 years ago
dtucker
f5ecdec08b
Ensure previous adjust has completed before clearing alarm flag; ok henning@
20 years ago
henning
3ce098c434
extra paranoia, from a discussion with joerg
20 years ago
henning
4395949868
zap includes, grunk
20 years ago
henning
79255b7f6b
fatal vs fatalx, Alexander von Gernler
20 years ago