1290001Sglebius/* -*- Mode: Text -*- */
2290001SglebiusAutoGen Definitions perlopt;
3290001Sglebius
4290001Sglebius#include autogen-version.def
5290001Sglebius
6290001Sglebiusprog-name	= calc_tickadj;
7290001Sglebiusprog-title	= 'Calculates "optimal" value for tick given ntp drift file.';
8290001Sglebiuspackage		= ntp;
9290001Sglebius#include	version.def
10290001Sglebius
11290001Sglebiuslong-opts;
12290001Sglebiusgnu-usage;
13290001Sglebius
14290001Sglebiusflag = {
15290001Sglebius    name        = drift-file;
16290001Sglebius    value       = d;
17290001Sglebius    arg-type    = string;
18290001Sglebius    arg-default = '/etc/ntp/drift';
19290001Sglebius    descrip     = 'Ntp drift file to use';
20290001Sglebius    doc         = 'Use the specified drift file for calculations';
21290001Sglebius};
22290001Sglebius
23290001Sglebiusflag = {
24290001Sglebius    name        = tick;
25290001Sglebius    value       = t;
26290001Sglebius    arg-type    = number;
27290001Sglebius    descrip     = 'Tick value of this host';
28290001Sglebius    doc         = 'The current tick which to adjustment will be calculated';
29290001Sglebius};
30290001Sglebius
31290001Sglebiusdoc-section = {
32290001Sglebius    ds-type     = 'DESCRIPTION';
33290001Sglebius    ds-format   = 'texi';
34290001Sglebius    ds-text     = <<- _EndOfDoc
35290001SglebiusThe @code{calc_tickadj} script uses provided ntp drift file to generate optimal
36290001Sglebiustick value. Generally, ntpd can do better job if the drift value is the
37290001Sglebiussmallest possible number. 
38290001Sglebius
39290001SglebiusThe example output of 
40290001Sglebius@example
41290001Sglebius$ ./calc_tickadj
42290001Sglebius81.699 (drift)
43290001Sglebius9999 usec; 9999779 nsec
44290001Sglebius$ cat /etc/ntp/drift
45290001Sglebius-23.159
46290001Sglebius@end example
47290001Sglebius
48290001Sglebiusmeans the following. If tick on that box is 10,000, by making the value 9999
49290001Sglebiuswe'll shift the box from its current drift of -23.159 to a drift of 81.699, and
50290001Sglebiusin doing so we'll speed the clock up a little every second instead of slowing
51290001Sglebiusthe clock down a little.
52290001Sglebius
53290001SglebiusIf 'tick' on that box is 10,000,000 then by setting it to 9999779 the drift
54290001Sglebiusvalue will be somewhere around 0.0.
55290001Sglebius
56290001Sglebius@code{calc_tickadj} tries to determine the the tick value by using
57290001Sglebius@code{tickadj} program from ntp package. If this doesn't work you can specify
58290001Sglebiuscurrent tick manually on command line.
59290001Sglebius	_EndOfDoc;
60290001Sglebius};
61