OSDN Git Service

Fix no pic
[uclinux-h8/uClinux-dist.git] / user / msntp / msntp.1
1 .TH MSNTP 1
2 .SH NAME
3 msntp \- a SNTP utility (command and daemon)
4 .SH SYNOPSIS
5 .B msntp
6 [
7 .B \-h
8 |
9 .B \-\-help
10 |
11 .B \-?
12 ] [
13 .B \-v
14 |
15 .B \-V
16 |
17 .B \-W
18 ] [
19 .B \-B
20 [
21 .I period
22 ] |
23 .B \-S
24 |
25 .B \-q
26 [
27 .BI \-f " savefile"
28 ] | [ {
29 .B \-r
30 |
31 .B \-a
32 } [
33 .BI \-P " prompt"
34 ] [
35 .BI \-l " lockfile"
36 ] ] [
37 .BI \-e " minerr"
38 ] [
39 .BI \-E " maxerr"
40 ] [
41 .BI \-c " count"
42 ] [
43 .BI \-d " delay"
44 |
45 .B \-x
46 [
47 .I separation
48 ] ] [
49 .BI \-f " savefile"
50 ] ] [
51 .I address(es)
52 ] ]
53 .SH DESCRIPTION
54 .PP
55 .I msntp
56 can be used as a SNTP client to query a NTP or SNTP server and either display
57 the time or set the local system's time (given suitable privilege).  It can be
58 run as an interactive command, in a
59 .I cron
60 job or as a daemon.  It can be run as a daemon to provide a SNTP server for
61 other clients.  NTP is the Network Time Protocol (RFC 1305) and SNTP is the
62 Simple Network Time Protocol (RFC 2030, which supersedes RFC 1769).
63 .SS Options
64 .PP
65 .I msntp
66 recognizes the following options:
67 .TP
68 .B \-h
69 displays the syntax error message.  If there are no other arguments, it then
70 stops; otherwise it then does what was requested.
71 .B \-\-help
72 and
73 .B \-?
74 are synonyms.
75 .TP
76 .B \-v
77 indicates that diagnostic messages for non-fatal errors and a limited amount of
78 tracing should be written to standard error.  Fatal ones always produce a
79 diagnostic.  This option should be set when there is a suspected problem with
80 the server, network or the source.
81 .TP
82 .B \-V
83 requests more and less comprehensible output, mainly for investigating problems
84 with apparently inconsistent timestamps.  This option should be set when the
85 program fails with a message indicating that is the trouble.
86 .TP
87 .B \-W
88 requests very verbose debugging output, and will interfere with the timing
89 when writing to the terminal (because of line buffered output from C).  Note
90 that the times produced by this are the corrections needed, and not the error
91 in the local clock.  This option should be set only when debugging the source.
92 .TP
93 .BI \-B " period"
94 indicates that it should behave as a server, broadcasting time packets at
95 intervals of
96 .I period
97 minutes (sic).  Acceptable values of
98 .I period
99 are from 1 to 1440 (a day), and the default (i.e. if
100 .B \-B
101 is specified but
102 .I period
103 is omitted) is 60.  Naturally, this will work only if the user has enough
104 privilege.
105 .TP
106 .B \-S
107 indicates that it should behave as a server, responding to time requests from
108 clients.  Naturally, this will work only if the user has enough privilege.
109 .TP
110 .B \-q
111 indicates that it should query a daemon save file being maintained by it.
112 This needs no privilege and will change neither the save file nor the clock.
113 .PP
114 The default is that it should behave as a client, and the following options
115 are then relevant:
116 .TP
117 .B \-r
118 indicates that the system clock should be reset by
119 .IR settimeofday .
120 Naturally, this will work only if the user has enough privilege.
121 .TP
122 .B \-a
123 indicates that the system clock should be reset by
124 .IR adjtime .
125 Naturally, this will work only if the user has enough privilege.
126 .PP
127 The default is to write the estimated correct local date and time (i.e. not
128 UTC) to the standard output in a format like
129 .BR "'1996 Oct 15 20:17:25.123 + 4.567 +/- 0.089 secs'" ,
130 where the
131 .B "'+ 4.567 +/- 0.089 secs'"
132 indicates the estimated error in the time on the local system.  In daemon mode,
133 it will add drift information in a format like
134 .BR "' + 1.3 +/- 0.1 ppm'" ,
135 and display this at roughly
136 .I separation
137 intervals (see under the
138 .B \-x
139 option for details).
140 .TP
141 .BI \-l " lockfile"
142 sets the name of the lock file to ensure that there is only
143 one copy of
144 .I msntp
145 running at once.  The default is installation-dependent, but will usually be
146 .IR /etc/msntp.pid .
147 .TP
148 .BI \-e " minerr"
149 sets the maximum ignorable variation between the clocks to
150 .IR minerr .
151 Acceptable values are from 0.001 to 1, and the default is 0.1 if a NTP host is
152 is specified and 0.5 otherwise.
153 .TP
154 .BI \-E " maxerr"
155 sets the maximum value of various delays that are deemed acceptable to
156 .IR maxerr .
157 Acceptable values are from 1 to 60, and the default is 5.  It should sometimes
158 be increased if there are problems with the network, NTP server or system
159 clock, but take care.
160 .TP
161 .BI \-P  " prompt"
162 sets the maximum clock change that will be made automatically to
163 .IR maxerr .
164 Acceptable values are from 1 to 3600 or
165 .IR no ,
166 and the default is 30.  If the program is being run interactively in ordinary
167 client mode, and the system clock is to be changed, larger corrections will
168 prompt the user for confirmation.  Specifying
169 .I no
170 will disable this and the correction will be made regardless.
171 .TP
172 .BI \-c " count"
173 sets the maximum number of NTP packets required to
174 .IR count .
175 Acceptable values are from 1 to 25 if a NTP host is specified and from 5 to 25
176 otherwise, and the default is 5.  If the maximum isn't enough, the system needs
177 a better consistency algorithm than this program uses.
178 .TP
179 .BI \-d " delay"
180 sets a rough limit on the total running time to
181 .I delay
182 seconds.  Acceptable values are from 1 to 3600, and the default is 15 if a NTP
183 host is specified and 300 otherwise.
184 .TP
185 .BI \-x " separation"
186 causes the program to run as a daemon (i.e. forever), and to estimate and 
187 correct for the clock drift.
188 .I separation
189 sets the minimum time between calls to the server in minutes if a NTP host is
190 specified, and between broadcast packets if not.  Acceptable values are from 1
191 to 1440 (a day), and the default (if
192 .B \-x
193 is specified but
194 .I separation
195 is omitted) is 300.
196 .TP
197 .BI \-f " savefile"
198 may be used with the
199 .B \-x
200 option to store a record of previous packets, which speeds up recalculating
201 the drift after
202 .I msntp
203 has to be restarted (e.g. because of network or server outages).  In order to
204 restart the data,
205 .I msntp
206 must be restarted reasonably soon after it died (within a few times the value of
207 .IR separation ),
208 with the same value of the
209 .B \-c
210 option, the same value of
211 .IR separation ,
212 in the same mode (i.e. broadcast or client), though the NTP servers need not
213 be the same for client mode, and with compatible values of other settings.
214 Note that the file will be created with the default ownerships and permissions,
215 using standard C facilities.  The default is installation-dependent, but will
216 usually be
217 .IR /etc/msntp.state .
218 .PP
219 .B address(es)
220 are the DNS names or IP numbers of hosts to use for the challenge and response
221 protocol; if no names are given, the program waits for broadcasts.  Polling a
222 server is vastly more reliable than listening to broadcasts.  Note that a
223 single component numeric address is not allowed, to avoid ambiguities.  If
224 more than one name is give, they will be used in a round-robin fashion.
225 .PP
226 Constraints:
227 .IP
228 .B minerr
229 must be less than
230 .B maxerr
231 which must be less than
232 .B delay
233 (or, if a NTP host is not specified
234 .BR delay / count "),"
235 and
236 .B count
237 must be less than half of
238 .BR delay .
239 .IP
240 In update mode,
241 .B maxerr
242 must be less than
243 .BR prompt.
244 .IP
245 In daemon mode (i.e. when
246 .B \-x
247 is specified),
248 .B minerr
249 must be less than
250 .B maxerr
251 which must be less than
252 .B separation
253 (note that this is in minutes, not seconds, but the numeric value is compared).
254 .PP
255 Note that none of the above values are closely linked to the limits described
256 in the NTP protocol (RFC 1305).
257 .SH USAGE
258 The simplest use of this program is as an unprivileged command to check the
259 current time and error in the local clock.  For example:
260 .IP
261 .B msntp ntpserver.somewhere
262 .PP
263 It can be run as a unprivileged background process to check on the clock drift
264 as well as the current error; this will probably fail if the local clock is
265 reset while it is running.  For example:
266 .IP
267 .B msntp -x ntpserver.somewhere > output 2>\&1 \&
268 .PP
269 With suitable privilege, it can be run as a command or in a
270 .I cron
271 job to reset the local clock from a reliable server, like the
272 .I ntpdate
273 and
274 .I rdate
275 commands.  For example:
276 .IP
277 .B msntp -a ntpserver.somewhere
278 .PP
279 It can also be run as a daemon to keep the local clock in step.  For example:
280 .IP
281 .B msntp -a -x ntpserver.somewhere > output 2>\&1 \&
282 .PP
283 More information on how to use this utility is given in the
284 .I README
285 file in the distribution.  In particular, this
286 .I man
287 page does not describe how to set it up as a server, which needs special care
288 to avoid propagating misinformation.
289 .SH RETURN VALUE
290 When used as a client in non-daemon mode, the program returns a zero exit
291 status for success, and a non-zero one otherwise. When used as a daemon
292 (either client or server), it does not return except after a serious error.
293 .SH BUGS
294 The program implements the SNTP protocol, and does not provide all NTP 
295 facilities.  In particular, it contains no checks against any form of spoofing.
296 If this is a serious concern, some network security mechanism (like a firewall
297 or even just
298 .IR tcpwrappers )
299 should be installed.
300 .PP
301 There are some errors, ambiguities and inconsistencies in the RFCs, and this
302 code may not interwork with all other NTP implementations.  Any unreasonable
303 restrictions should be reported as bugs to whoever is responsible.  It may
304 be difficult to find out who that is.
305 .PP
306 The program will stop as soon as it feels that things have got out of control.
307 In client daemon mode, it will usually fail during an extended period of
308 network or server inaccessibility or excessively slow performance, or when the
309 local clock is reset by another process.  It will then need restarting
310 manually.  Experienced system administrators can write a shell script, a
311 .I cron
312 job or put it in
313 .IR inittab ,
314 to do this automatically.
315 .PP
316 The error cannot be estimated reliably with broadcast packets or for the drift
317 in daemon mode (even with client-server packets), and the guess made by the
318 program may be wrong (possibly even very wrong).  If this is a problem, then
319 setting the
320 .B \-c
321 option to a larger value may help.  Or it may not.
322 .SH AUTHOR
323 .I msntp
324 was developed by N.M. Maclaren of the University of Cambridge Computing
325 Service.