Source code pulled from OpenBSD for OpenNTPD. The place to contribute to this code is via the OpenBSD CVS tree.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

161 lines
3.8 KiB

13 years ago
20 years ago
20 years ago
20 years ago
13 years ago
  1. .\" $OpenBSD: ntpd.8,v 1.41 2017/09/06 19:43:46 jmc Exp $
  2. .\"
  3. .\" Copyright (c) 2003, 2004, 2006 Henning Brauer <henning@openbsd.org>
  4. .\"
  5. .\" Permission to use, copy, modify, and distribute this software for any
  6. .\" purpose with or without fee is hereby granted, provided that the above
  7. .\" copyright notice and this permission notice appear in all copies.
  8. .\"
  9. .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  10. .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  11. .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  12. .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  13. .\" WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER IN
  14. .\" AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
  15. .\" OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  16. .\"
  17. .Dd $Mdocdate: September 6 2017 $
  18. .Dt NTPD 8
  19. .Os
  20. .Sh NAME
  21. .Nm ntpd
  22. .Nd Network Time Protocol daemon
  23. .Sh SYNOPSIS
  24. .Nm ntpd
  25. .Bk -words
  26. .Op Fl dnSsv
  27. .Op Fl f Ar file
  28. .Ek
  29. .Sh DESCRIPTION
  30. The
  31. .Nm
  32. daemon synchronizes the local clock to one or more remote NTP servers
  33. or local timedelta sensors.
  34. .Nm
  35. can also act as an NTP server itself,
  36. redistributing the local time.
  37. It implements the Simple Network Time Protocol version 4,
  38. as described in RFC 5905,
  39. and the Network Time Protocol version 3,
  40. as described in RFC 1305.
  41. Time can also be fetched from TLS HTTPS servers to reduce the
  42. impact of unauthenticated NTP
  43. man-in-the-middle attacks.
  44. .Pp
  45. The options are as follows:
  46. .Bl -tag -width "-f fileXXX"
  47. .It Fl d
  48. Do not daemonize.
  49. If this option is specified,
  50. .Nm
  51. will run in the foreground and log to
  52. .Em stderr .
  53. .It Fl f Ar file
  54. Use
  55. .Ar file
  56. as the configuration file,
  57. instead of the default
  58. .Pa /etc/ntpd.conf .
  59. .It Fl n
  60. Configtest mode.
  61. Only check the configuration file for validity.
  62. .It Fl S
  63. Do not set the time immediately at startup.
  64. This is the default.
  65. .It Fl s
  66. Try to set the time immediately at startup, as opposed to slowly adjusting the
  67. clock.
  68. .Nm
  69. will stay in the foreground for up to 15 seconds waiting for one of the
  70. configured NTP servers to reply.
  71. .It Fl v
  72. This option allows
  73. .Nm
  74. to send DEBUG priority messages to syslog.
  75. .El
  76. .Pp
  77. .Nm
  78. uses the
  79. .Xr adjtime 2
  80. system call to correct the local system time without causing time jumps.
  81. Adjustments of 32ms and greater are logged using
  82. .Xr syslog 3 .
  83. The threshold value is chosen to avoid having local clock drift
  84. thrash the log files.
  85. Should
  86. .Nm
  87. be started with the
  88. .Fl d
  89. or
  90. .Fl v
  91. option, all calls to
  92. .Xr adjtime 2
  93. will be logged.
  94. .Pp
  95. After the local clock is synchronized,
  96. .Nm
  97. adjusts the clock frequency using the
  98. .Xr adjfreq 2
  99. system call to compensate for systematic drift.
  100. .Pp
  101. .Nm
  102. is started at boot time by default via
  103. .Va ntpd_flags
  104. in
  105. .Pa /etc/rc.conf .
  106. See
  107. .Xr rc 8
  108. and
  109. .Xr rc.conf 8
  110. for more information on the boot process
  111. and enabling daemons.
  112. .Pp
  113. When
  114. .Nm
  115. starts up, it reads settings from its configuration file,
  116. typically
  117. .Xr ntpd.conf 5 ,
  118. and its initial clock drift from
  119. .Pa /var/db/ntpd.drift .
  120. Clock drift is periodically written to the drift file thereafter.
  121. .Sh FILES
  122. .Bl -tag -width "/var/db/ntpd.driftXXX" -compact
  123. .It Pa /etc/ntpd.conf
  124. Default configuration file.
  125. .It Pa /var/db/ntpd.drift
  126. Drift file.
  127. .It Pa /var/run/ntpd.sock
  128. Socket file for communication with
  129. .Xr ntpctl 8 .
  130. .El
  131. .Sh SEE ALSO
  132. .Xr date 1 ,
  133. .Xr adjfreq 2 ,
  134. .Xr adjtime 2 ,
  135. .Xr ntpd.conf 5 ,
  136. .Xr ntpctl 8 ,
  137. .Xr rc 8 ,
  138. .Xr rc.conf 8 ,
  139. .Xr rdate 8
  140. .Sh STANDARDS
  141. .Rs
  142. .%A David L. Mills
  143. .%D March 1992
  144. .%R RFC 1305
  145. .%T Network Time Protocol (Version 3): Specification, Implementation and Analysis
  146. .Re
  147. .Pp
  148. .Rs
  149. .%A David L. Mills
  150. .%A Jim Martin
  151. .%A Jack Burbank
  152. .%A William Kasch
  153. .%D June 2010
  154. .%R RFC 5905
  155. .%T Network Time Protocol Version 4: Protocol and Algorithms Specification
  156. .Re
  157. .Sh HISTORY
  158. The
  159. .Nm
  160. program first appeared in
  161. .Ox 3.6 .