xref: /original-bsd/usr.sbin/timed/timed/timed.8 (revision 36527226)
1.\" Copyright (c) 1980, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.roff%
5.\"
6.\"     @(#)timed.8	8.1 (Berkeley) 06/06/93
7.\"
8.Dd
9.Dt TIMED 8
10.Os BSD 4.3
11.Sh NAME
12.Nm timed
13.Nd time server daemon
14.Sh SYNOPSIS
15.Nm timed
16.Op Fl M
17.Op Fl t
18.Op Fl d
19.Op Fl i Ar network
20.Op Fl n Ar network
21.Op Fl F Ar host1 host2 ...
22.Sh DESCRIPTION
23This
24is a time server daemon and is normally invoked
25at boot time from the
26.Xr rc 8
27file.
28It synchronizes the host's time with the time of other
29machines in a local area network running
30.Nm timed 8 .
31These time servers will slow down the clocks of some machines
32and speed up the clocks of others to bring them to the average network time.
33The average network time is computed from measurements of clock differences
34using the
35.Tn ICMP
36timestamp request message.
37.Pp
38The service provided by
39.Nm timed
40is based  on a master-slave
41scheme.
42When
43.Nm timed 8
44is started on a machine, it asks the master for the network time
45and sets the host's clock to that time.
46After that, it accepts synchronization messages periodically sent by
47the master and calls
48.Xr adjtime 2
49to perform the needed corrections on the host's clock.
50.Pp
51It also communicates with
52.Xr date 1
53in order to set the date globally,
54and with
55.Xr timedc 8 ,
56a timed control program.
57If the machine running the master crashes, then the slaves will elect
58a new master from among slaves running with the
59.Fl M
60flag.
61A
62.Nm timed
63running without the
64.Fl M
65or
66.Fl F
67flags will remain a slave.
68The
69.Fl t
70flag enables
71.Nm timed
72to trace the messages it receives in the
73file
74.Pa /var/log/timed.log .
75Tracing can be turned on or off by the program
76.Xr timedc 8 .
77The
78.Fl d
79flag is for debugging the daemon.
80It causes the program to not put itself into the background.
81Normally
82.Nm timed
83checks for a master time server on each network to which
84it is connected, except as modified by the options described below.
85It will request synchronization service from the first master server
86located.
87If permitted by the
88.Fl M
89flag, it will provide synchronization service on any attached networks
90on which no current master server was detected.
91Such a server propagates the time computed by the top-level master.
92The
93.Fl n
94flag, followed by the name of a network which the host is connected to
95(see
96.Xr networks 5 ) ,
97overrides the default choice of the
98network addresses made by the program.
99Each time the
100.Fl n
101flag appears, that network name is added to a list of valid networks.
102All other networks are ignored.
103The
104.Fl i
105flag, followed by the name of a network to which the host is connected
106(see
107.Xr networks 5 ) ,
108overrides the default choice of the network addresses made by the program.
109Each time the
110.Fl i
111flag appears, that network name is added to a list of networks to ignore.
112All other networks are used by the time daemon.
113The
114.Fl n
115and
116.Fl i
117flags are meaningless if used together.
118.Pp
119.Nm Timed
120checks for a master time server on each network to which
121it is connected, except as modified by the
122.Fl n
123and
124.Fl i
125options described above.
126If it finds masters on more than one network, it chooses one network
127on which to be a "slave," and then periodically checks the other
128networks to see if the masters there have disappeared.
129.Pp
130One way to synchronize a group of machines is to use an NTP daemon to
131synchronize the clock of one machine to a distant standard or a radio
132receiver and
133.Fl F Ar hostname
134to tell its timed daemon to trust only itself.
135.Pp
136Messages printed by the kernel on the system console occur with
137interrupts disabled.
138This means that the clock stops while they are printing.
139A machine with many disk or network hardware problems and consequent
140messages cannot keep good time by itself.  Each message typically causes
141the clock to lose a dozen milliseconds.  A time daemon can
142correct the result.
143.Pp
144Messages in the system log about machines that failed to respond
145usually indicate machines that crashed or were turned off.
146Complaints about machines that failed to respond to initial time
147settings are often associated with "multi-homed" machines
148that looked for time masters on more than one network and eventually
149chose to become a slave on the other network.
150.SH WARNING
151If two or more time daemons, whether
152.Nm timed ,
153.Xr NTP ,
154try to adjust the same clock, temporal chaos will result.
155If both
156.Nm
157and another time daemon are run on the same machine,
158ensure that the
159.Fl F
160flag is used, so that
161.Nm timed
162never attempts to adjust the local clock.
163.Pp
164The protocol is based on UDP/IP broadcasts.  All machines within
165the range of a broadcast that are using the TSP protocol must cooperate.
166There cannot be more than a single administrative domain using the
167.Fl F
168flag among all machines reached by a broadcast packet.
169Failure to follow this rule is usually indicated by complaints concerning
170"untrusted" machines in the system log.
171.Sh FILES
172.Bl -tag -width /var/log/timed.masterlog -compact
173.It Pa /var/log/timed.log
174tracing file for timed
175.It Pa /var/log/timed.masterlog
176log file for master timed
177.El
178.Sh SEE ALSO
179.Xr date 1 ,
180.Xr adjtime 2 ,
181.Xr gettimeofday 2 ,
182.Xr icmp 4 ,
183.Xr timedc 8 ,
184.Rs
185.%T "TSP: The Time Synchronization Protocol for UNIX 4.3BSD"
186.%A R. Gusella
187.%A S. Zatti
188.Re
189.Sh HISTORY
190The
191.Nm
192daemon appeared in
193.Bx 4.3 .
194