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