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.

162 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.40 2015/10/30 16:41:53 reyk 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: October 30 2015 $
  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 usually started at boot time, and can be enabled by
  103. setting
  104. .Va ntpd_flags
  105. in
  106. .Pa /etc/rc.conf.local .
  107. See
  108. .Xr rc 8
  109. and
  110. .Xr rc.conf 8
  111. for more information on the boot process
  112. and enabling daemons.
  113. .Pp
  114. When
  115. .Nm
  116. starts up, it reads settings from its configuration file,
  117. typically
  118. .Xr ntpd.conf 5 ,
  119. and its initial clock drift from
  120. .Pa /var/db/ntpd.drift .
  121. Clock drift is periodically written to the drift file thereafter.
  122. .Sh FILES
  123. .Bl -tag -width "/var/db/ntpd.driftXXX" -compact
  124. .It Pa /etc/ntpd.conf
  125. Default configuration file.
  126. .It Pa /var/db/ntpd.drift
  127. Drift file.
  128. .It Pa /var/run/ntpd.sock
  129. Socket file for communication with
  130. .Xr ntpctl 8 .
  131. .El
  132. .Sh SEE ALSO
  133. .Xr date 1 ,
  134. .Xr adjfreq 2 ,
  135. .Xr adjtime 2 ,
  136. .Xr ntpd.conf 5 ,
  137. .Xr ntpctl 8 ,
  138. .Xr rc 8 ,
  139. .Xr rc.conf 8 ,
  140. .Xr rdate 8
  141. .Sh STANDARDS
  142. .Rs
  143. .%A David L. Mills
  144. .%D March 1992
  145. .%R RFC 1305
  146. .%T Network Time Protocol (Version 3): Specification, Implementation and Analysis
  147. .Re
  148. .Pp
  149. .Rs
  150. .%A David L. Mills
  151. .%A Jim Martin
  152. .%A Jack Burbank
  153. .%A William Kasch
  154. .%D June 2010
  155. .%R RFC 5905
  156. .%T Network Time Protocol Version 4: Protocol and Algorithms Specification
  157. .Re
  158. .Sh HISTORY
  159. The
  160. .Nm
  161. program first appeared in
  162. .Ox 3.6 .