⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ntpd.8

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 8
字号:
.\" SCCSID: @(#)nfsd.8nfs	5.2	4/5/89.TH ntpd 8.SH Namentpd \- network time protocol (NTP) daemon.SH Syntax.B /usr/etc/ntpd[.B \-a.I threshold][.B \-c.I file][.B \-d][.B \-D \fIlevel\fP][.B \-l][.B \-n][.B \-s].SH Description.NXR "ntpd daemon"The University of Maryland's.PN ntpd daemon synchronizes the local clock with a set of distributedtime servers.  The.PN ntpddaemon distributes accurate, reliable time from the best time sourceavailable at your site to hosts on wide area networks (WAN)and local area networks (LAN).  The three recommended timesources in decreasing order of accuracy are:  Internet NTP service,local radio clock, and wristwatch.  Note that the .PN ntpddaemon does not require time servers to be on the same LAN astime clients, and does not create a heavy broadcast load on thenetwork..NTIf the NTP servers are not on your Local Area Network (LAN),you must run the .PN routeddaemon before running the .PN ntpddaemon.  To run .PN routed ,remove the number signs (#) from in front of the following linesin your.PN /etc/rc.local file:.EX#[ \-f /etc/routed ] && {#       /etc/routed & echo 'routed'             >/dev/console#}.EEThe .PN routed daemon will be invoked when you reboot your system.  To start .PN routed without rebooting, type the following on the command line:.EX \f(CB/etc/routed\f(CW.EE.NEFor information on setting up the network time services, seethe .I Guide to System and Network Setup..PPThe.PN ntpd daemon automatically splits the nodes running the.PN ntpddaemon into a dynamically reconfigurablehierarchy of nodes.  The nodes at the top level of the hierarchy (low stratum numbers) areconnected to the most accurate sources available.This information is transferred to the lower-level nodes(higher stratum numbers) which set their clocks basedon the calculated offset from a remote server, and thendistribute this time to lower levels of the hierarchy.  .PPThe .PN ntpddaemon provides a solution for distributing time to a large number ofindividual workstations.  Itcan also be used in conjunction with a master.PN timed daemon to distribute NTP time to workstations running.PN timed .If .PN timedis run with the .PN \-Eand .PN \-M options on at least one system that is also running.PN ntpd ,then all other systems on the network running.PN timedcan receive time updates from a hostrunning.PN ntpd .Although.PN timedis easier to set up on clients, NTP is recommendedbecause it is more accurate and more secure..PPNormally, the.PN ntpd daemon is invoked at boot time from the.PN /etc/rc.localfile.  When .PN ntpdis started, it reads configuration information from the .PN /etc/ntp.conffile, unless you have specified another configuration file with the.PN \-coption.  The configuration file either specifies the list of NTPservers with which this host should synchronize, or identifiesthis host as a local reference clock.  See the.MS ntp.conf 5reference page for more information on the.PN /etc/ntp.confconfiguration file..PPThe .PN ntpddaemon uses the.MS adjtime 2system call to gradually adjust the local clock forsmall clock offsets (< 0.128 seconds).If the local clocklags the time on the server by more than 0.128 seconds, the.MS settimeofday 2system call is used to make a forward step adjustment of the local clock.  Clocks are never steppedbackwards; they are adjusted gradually, which can take a very long time.  Therefore, it is important to initialize the time using the.PN ntpcommand before running the.PN ntpddaemon. .SH Options.IP "\-a \fIthreshold\fP" 5Sets the threshold (in seconds) which limits howfar the.PN ntpddaemon can change the local clock.By default, the threshold is 1000 seconds.  This is set to avoid propagating major mistakes throughout thenetwork.  If you specify the string.PN anyinstead of a number, the.PN ntpddaemon can change the local clock by any amount.  .IP "\-c \fIfile\fP" 5Specifies a configuration file for the.PN ntpddaemon.  By default, the configuration file is.PN /etc/ntp.conf ..IP \-dIncrements the debug level by one.  The.PN \-doption can be specified more than once.Higher debug levels provide more diagnostic information..IP "\-D \fIlevel\fP"Sets the debug level to the specified value..IP \-lCauses the .PN ntpddaemon to log a message each time the local clock is adjusted.Specify this option only if you want to gather statisticalinformation to analyze the local clock behavior.  If the.PN \-loption is set, a message may be logged every two minutes.Messages are logged to .PN /usr/spool/mqueue/syslog ..IP \-nInhibits the .PN ntpdprogram from being swapped out of memory.  Using the.PN \-noption is recommended for both time servers and time clients..IP \-s 5Prevents the.PN ntpd daemon from altering the time on the local host.The .PN ntpddaemon participates as an NTP server with the.PN \-sflag set, but it does not change the time of the local host..SH ExamplesBefore starting the .PN ntpddaemon, either manually or from the.PN /etc/rc.localfile, you must edit the .PN /etc/ntp.conffile with the appropriate information.  If your system is a clientyou must specify the time servers for it to query.  If it is atime server, you must specify the time servers with which itpeers.  See the.MS ntp.conf 5reference page for more information..PPTo start the .PN ntpddaemon manually (on a time client), enter the following commands:.EX# \f(CB/etc/rdate \-s\fP# \f(CB/usr/etc/ntp \-s \-f \fIserver1\fP \fIserver2\fP \fIserver3\fP# \f(CB/usr/etc/ntpd \-n\fP.EEThe .PN /etc/rdatecommand initializes your time to the average network time.  The .PN /usr/etc/ntpcommand further refines the initial time to the NTP time.The servers specified on the command lineare the same as those specified in the.PN /etc/ntp.conffile..PPTo start the .PN ntpd daemon from the .PN /etc/rc.localfile (on a time client), place the following entries in the.PN /etc/rc.localfile.  Multiple servers are included in case one of the servers crashes, oris brought down.  The servers specified in the.PN /etc/rc.localfile are the same as those specified in the .PN /etc/ntp.conf file.  These entriesshould be placed after the.PN syslogentry:.EX[\-f /etc/syslog] && {     /etc/syslog   & echo \-n ' syslog'           >/dev/console}[\-f /etc/rdate] && {     /etc/rdate \-s   & echo \-n ' rdate'          >/dev/console}[\-f /usr/etc/ntp] && {     /usr/etc/ntp \-s \-f \fIserver1\fP \fIserver2\fP \fIserver3\fP \\                      & echo \-n ' ntp'           >/dev/console}[\-f /usr/etc/ntpd] && {     /usr/etc/ntpd \-n & echo \-n ' ntpd'          >/dev/console     }.EE.SH DiagnosticsThe .PN ntpd daemon logs errors, major state changes, and statisticsreports using the .PN syslog daemon; the log entries appear in the file.PN /usr/spool/mqueue/syslog with the word .PN ntpd:on each	relevant line.  Normal log entries show when .PN ntpd gains or loses synchronization with a lower-stratum host.  Also,once an hour .PN ntpd issues a .PN "ntpd: stats:" entry that gives information about its state..PPOnce an hour, if .PN ntpd is synchronized, it updates the.PN /etc/ntp.drift file.  This file shows the estimatedclock drift for each of the past 5 hours, with the most recenthour listed first.  (The 6th number in this file is thenumber of hours .PN ntpd has been running).  To convert thedrift values to parts per million (ppm), divide themby 4096 and multiply by 1000000.  For example, +0.0107001161means that .PN ntpd estimates that the clock is driftingby about 2.61 ppm, or is losing about 0.226 seconds per day.[(2.61/1000000) * 24 * 60 * 60 = 0.226].  Negative driftvalues mean that the clock is gaining time.  If .PN ntpdis working, your computer's clock should beaccurate to within a few seconds per day..PPAnother diagnostic tool is the .PN ntpdc command.  You can use this to look at any host running .PN ntpd .The following command line returns the state of the remote host's .PN ntpd server:.EX % \f(CB/usr/etc/ntpdc \fIhostname\fP.EE.PPThe value that is returned for the .PN offset should contain values not greater than100 milliseconds.  See the .MS ntpdc 8reference page for more information..PPIf the.PN ntpddaemon sets the time as frequently as every 10 minutes (indicatedby messages in the.PN /usr/spool/mqueue/syslogfile), then you should kill the.PN ntpd daemon, remove the .PN /etc/ntp.drift file, run the.PN ntpcommand to initialize the time, and restart the .PN ntpddaemon..PPIf your system clock is ahead of the server time by more than 1second, you should kill the.PN ntpddaemon, remove the.PN /etc/ntp.driftfile, run the.PN ntpcommand to initialize the time, and restart the.PN ntpddaemon..PPIf your clock is more than 1000 seconds off from the servertime, and you did not specify the .PN "\-a any"option, .PN ntpdwill not change your system time.  Rather, .PN ntpdwill repeatedly log messages to the.PN /usr/spool/mqueue/syslogfile, indicating that the time is too far off to reset..SH See Alsontp(1), adjtime(2), settimeofday(2), ntp.conf(5), ntpdc(8), timed(8).br\fIRFC 1129\(emInternet Time Synchronization:  the Network Time Protocol\fP.br.I "Guide to System and Network Setup".br.I "Introduction to Networking and Distributed System Services"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -