/contrib/ntp/html/build/hints/solaris.html

https://bitbucket.org/freebsd/freebsd-head/ · HTML · 144 lines · 141 code · 3 blank · 0 comment · 0 complexity · 262d1c0b69d7666cd66c89ddf7b18f1f MD5 · raw file

  1. <HTML>
  2. <HEAD>
  3. <TITLE>Solaris hints and kinks</title><link href="scripts/style.css" type="text/css" rel="stylesheet">
  4. </HEAD>
  5. <BODY>
  6. Information on compiling and executing ntpd under Solaris.
  7. <BR>
  8. Last Updated: Sun Jun 21 01:32:18 EDT 1998,
  9. John Hawkinson,
  10. <! -- This is deliberately not a mailto -- > &lt;jhawk@MIT.EDU&gt;
  11. <P>
  12. If you're not running Solaris 2.5.1 or later, it is likely
  13. that you will have problems; upgrading would be a really good plan.
  14. <P>
  15. <H3>All Solaris versions</H3>
  16. <P>
  17. We have a report that says starting with Solaris 2.6 we should leave
  18. <I>dosynctodr</I> alone.
  19. <A HREF="solaris-dosynctodr.html">Here is the report</A>.
  20. <P>
  21. Proper operation of ntp under Solaris may require setting the kernel
  22. variable <I>dosynctodr</I> to zero (meaning "do not synchronize the clock
  23. to the hardware time-of-day clock"). This can be done with the
  24. tickadj utility:
  25. <BLOCKQUOTE><TT>
  26. tickadj -s
  27. </TT></BLOCKQUOTE>
  28. If you prefer, it can also be done with the native Solaris kernel debugger:
  29. <BLOCKQUOTE><TT>
  30. echo dosynctodr/W0 | adb -k -w /dev/ksyms /dev/mem
  31. </BLOCKQUOTE></TT>
  32. <P>
  33. Or, it can also be set by adding a line to /etc/system:
  34. <BLOCKQUOTE><TT>
  35. set dosynctodr = 0
  36. </BLOCKQUOTE></TT>
  37. <P>
  38. Instead of the <I>tick</I> kernel variable, which many operating
  39. systems use to control microseconds added to the system time every
  40. clock tick (c.f. <A HREF="../../notes.html#frequency_tolerance">Dealing
  41. with Frequency Tolerance Violations</A>), Solaris has the variables
  42. <I>nsec_per_tick</I> and <I>usec_per_tick</I>.
  43. <P>
  44. <I>nsec_per_tick</I> and <I>usec_per_tick</I> control the number of
  45. nanoseconds and microseconds, respectively, added to the system clock
  46. each clock interrupt. Enterprising souls may set these based on
  47. information collected by ntpd in the <CODE>/etc/ntp.drift</CODE> file
  48. to correct for individual hardware variations.
  49. <P>
  50. On UltraSPARC systems, <I>nsec_per_tick</I> and <I>usec_per_tick</I>
  51. are ignored in favor of the <I>cpu_tick_freq</I> variable, which
  52. should be automatically be determined by the PROM in an accurate
  53. fashion.
  54. <P>
  55. In general, the same ntp binaries should not be used across multiple
  56. operating system releases. There is enough variation in the core operating
  57. system support for timekeeping that a rebuild of ntpd for the idiosyncracies
  58. of your specific operating system version is advisable.
  59. <P>
  60. It is recommended that ntp be started via a script like <A
  61. HREF="solaris.xtra.S99ntpd">this one</A>, installed in
  62. <CODE>/etc/init.d/ntpd</CODE> with a symbol link from
  63. <CODE>/etc/rc2.d/S99ntpd</CODE>.
  64. <H3>Solaris 2.6</H3>
  65. <P>
  66. Solaris 2.6 adds support for kernel PLL timekeeping, but breaks this
  67. support in such a fashion that using it worse than not. This is <A
  68. HREF="solaris.xtra.4095849"> SUN Bug ID 4095849</A>, and it is not yet
  69. fixed as of June 1998.
  70. <P>
  71. <H3>Solaris 2.5 and 2.5.1</H3>
  72. <P>
  73. On UltraSPARC systems, calculation of <I>cpu_tick_freq</I> is broken
  74. such that values that are off by significant amounts may be used
  75. instead. This unfortunately means that ntpd may have severe problems
  76. keeping synchronization. This is <A HREF="solaris.xtra.4023118"> SUN Bug ID
  77. 4023118</A>. Bryan Cantrill <! -- &lt;bmc@eng.sun.com&gt; --> of Sun
  78. posted <A HREF="solaris.xtra.patchfreq">patchfreq</A>, a workaround script,
  79. to comp.protocols.time.ntp in March of 1997.
  80. <P>
  81. <HR>
  82. <H2>OLD DATA</H2>
  83. <STRONG>I can't vouch for the accuracy the information below this
  84. rule. It may be significantly dated or incorrect.</STRONG>
  85. <P>
  86. <P>
  87. <H3>Solaris 2.2</H3>
  88. <P>
  89. Solaris 2.2 and later contain completely re-written clock code to
  90. provide high resolution microsecond timers. A benefit of the
  91. re-written clock code is that adjtime does not round off its
  92. adjustments, so ntp does not have to compensate for this
  93. rounding. Under Solaris 2.2 and later, ntp #define's
  94. <CODE>ADJTIME_IS_ACCURATE</CODE>, and does not look for the <I>tickadj</I>
  95. kernel variable.
  96. <P>
  97. <H3>Solaris 2.1</H3>
  98. (This originally written by William L. Jones &lt;jones@chpc.utexas.edu&gt;)
  99. <P>
  100. Solaris 2.1 contains fairly traditional clock code, with <I>tick</I>
  101. and <I>tickadj</I>.
  102. <P>
  103. Since settimeofday under Solaris 2.1 only sets the seconds part of timeval
  104. care must be used in starting xntpd. I suggest the following start
  105. up script:
  106. <BLOCKQUOTE><TT>
  107. tickadj -s -a 1000
  108. <BR>ntpdate -v server1 server2
  109. <BR>sleep 20
  110. <BR>ntpdate -v server1 server2
  111. <BR>sleep 20
  112. <BR>tickadj -a 200
  113. <BR>xntpd
  114. </TT></BLOCKQUOTE>
  115. The first tickadj turns of the time of day clock and sets the tick
  116. adjust value to 1 millisecond. This will insure that an adjtime value
  117. of at most 2 seconds will complete in 20 seconds.
  118. <P>
  119. The first ntpdate will set the time to within two seconds
  120. using settimeofday or it will adjust time using adjtime.
  121. <P>
  122. The first sleep insures the adjtime has completed for the first ntpdate.
  123. <P>
  124. The second ntpdate will use adjtime to set the time of day since the
  125. clock should be within 2 seconds of the correct time.
  126. <P>
  127. The second tickadj set the tick adjust system value to 5 microseconds.
  128. <P>
  129. The second sleeps insure that adjtime will complete before starting
  130. the next xntpd.
  131. <P>
  132. I tried running with a tickadj of 5 microseconds with out much success.
  133. 200 microseconds seems to work well.
  134. <P>
  135. <HR>
  136. Prior versions of this file had major text contributed by:
  137. <MENU>
  138. <LI>Denny Gentry &lt;denny@eng.sun.com&gt;
  139. </MENU>
  140. <BODY>
  141. </HTML>