a-ux revision 1.1.1.1.28.2 1 1.1.1.1.28.2 msaitoh -------------
2 1.1.1.1.28.2 msaitoh INTRODUCTION:
3 1.1.1.1.28.2 msaitoh -------------
4 1.1.1.1.28.2 msaitoh Last revision: 06-Jul-1994
5 1.1.1.1.28.2 msaitoh
6 1.1.1.1.28.2 msaitoh Included in this distribution of XNTP V3 is a configuration file suitable
7 1.1.1.1.28.2 msaitoh for use under Apple's A/UX Version 3.x.x There is also one for A/UX 2.0.1
8 1.1.1.1.28.2 msaitoh but it has not been fully tested. To make the executables follow the steps
9 1.1.1.1.28.2 msaitoh outlined below.
10 1.1.1.1.28.2 msaitoh
11 1.1.1.1.28.2 msaitoh *** NOTE: You must have gcc installed to successfully compile the current
12 1.1.1.1.28.2 msaitoh distribution; the native cc supplied with A/UX will NOT correctly compile
13 1.1.1.1.28.2 msaitoh this source. See the FAQ in comp.unix.aux for places to obtain gcc from
14 1.1.1.1.28.2 msaitoh and how to install it.
15 1.1.1.1.28.2 msaitoh
16 1.1.1.1.28.2 msaitoh ----------------------
17 1.1.1.1.28.2 msaitoh MAKING XNTPD FOR A/UX:
18 1.1.1.1.28.2 msaitoh ----------------------
19 1.1.1.1.28.2 msaitoh
20 1.1.1.1.28.2 msaitoh First, you need to create the makefiles (after you've downloaded the
21 1.1.1.1.28.2 msaitoh source, of course):
22 1.1.1.1.28.2 msaitoh
23 1.1.1.1.28.2 msaitoh % make clean
24 1.1.1.1.28.2 msaitoh % make refconf
25 1.1.1.1.28.2 msaitoh
26 1.1.1.1.28.2 msaitoh After that, you should edit Config.local to make sure that BINDIR is
27 1.1.1.1.28.2 msaitoh correct for where you wish the programs to be "installed". The default
28 1.1.1.1.28.2 msaitoh (and what I use) is /usr/local/etc. Make sure that DEFS_LOCAL and
29 1.1.1.1.28.2 msaitoh CLOCKDEFS are commented out! Presently, only the LOCAL_CLOCK/REFCLOCK
30 1.1.1.1.28.2 msaitoh clock is used and supported.
31 1.1.1.1.28.2 msaitoh
32 1.1.1.1.28.2 msaitoh
33 1.1.1.1.28.2 msaitoh After this is done (you should be told that your system is A/UX 3), make
34 1.1.1.1.28.2 msaitoh 'xntpd' (the options to 'gcc' are held in compilers/aux3.gcc):
35 1.1.1.1.28.2 msaitoh
36 1.1.1.1.28.2 msaitoh % make
37 1.1.1.1.28.2 msaitoh
38 1.1.1.1.28.2 msaitoh I do not normally use the `make install' option and so have not verified its
39 1.1.1.1.28.2 msaitoh compatibility with A/UX. Rather, I pull out each of the executables and
40 1.1.1.1.28.2 msaitoh place them in the locally appropriate locations.
41 1.1.1.1.28.2 msaitoh
42 1.1.1.1.28.2 msaitoh ---------------
43 1.1.1.1.28.2 msaitoh STARTING XNTPD:
44 1.1.1.1.28.2 msaitoh ---------------
45 1.1.1.1.28.2 msaitoh
46 1.1.1.1.28.2 msaitoh At this point you need to set things up so that 'xntpd' is started upon
47 1.1.1.1.28.2 msaitoh boot-up. You can do this in 1 of 2 ways: either add entries in /etc/inittab
48 1.1.1.1.28.2 msaitoh or, more ideally, create and use an /etc/rc.local file. Since rc.local is
49 1.1.1.1.28.2 msaitoh what I recommend, here's how you do it:
50 1.1.1.1.28.2 msaitoh
51 1.1.1.1.28.2 msaitoh By default, A/UX doesn't have rc.local, so you'll need to add the following to
52 1.1.1.1.28.2 msaitoh /etc/inittab:
53 1.1.1.1.28.2 msaitoh
54 1.1.1.1.28.2 msaitoh net6:2:wait:/etc/syslogd # set to "wait" to run a syslog daemon
55 1.1.1.1.28.2 msaitoh + jmj0:2:wait:/etc/rc.local 1>/dev/syscon 2>&1 # Local stuff
56 1.1.1.1.28.2 msaitoh dbg2::wait:/etc/telinit v # turn off init's verbose mode
57 1.1.1.1.28.2 msaitoh
58 1.1.1.1.28.2 msaitoh Now, the look of a sample /etc/rc.local is as follows:
59 1.1.1.1.28.2 msaitoh
60 1.1.1.1.28.2 msaitoh #!/bin/sh
61 1.1.1.1.28.2 msaitoh :
62 1.1.1.1.28.2 msaitoh : rc.local
63 1.1.1.1.28.2 msaitoh :
64 1.1.1.1.28.2 msaitoh # @(#)Copyright Apple Computer 1987 Version 1.17 of rc.sh on 91/11/08 15:56:21 (ATT 1.12)
65 1.1.1.1.28.2 msaitoh
66 1.1.1.1.28.2 msaitoh
67 1.1.1.1.28.2 msaitoh # Push line discipline/set the device so it will print
68 1.1.1.1.28.2 msaitoh /etc/line_sane 1
69 1.1.1.1.28.2 msaitoh echo " "
70 1.1.1.1.28.2 msaitoh echo "Entering rc.local..."
71 1.1.1.1.28.2 msaitoh
72 1.1.1.1.28.2 msaitoh set `/bin/who -r`
73 1.1.1.1.28.2 msaitoh if [ "$7" = 2 ]
74 1.1.1.1.28.2 msaitoh then
75 1.1.1.1.28.2 msaitoh /bin/echo " now setting the time..."
76 1.1.1.1.28.2 msaitoh /usr/local/etc/ntpdate -s -b <host.domain>
77 1.1.1.1.28.2 msaitoh sleep 5
78 1.1.1.1.28.2 msaitoh #
79 1.1.1.1.28.2 msaitoh # start up 'xntpd' if we want
80 1.1.1.1.28.2 msaitoh #
81 1.1.1.1.28.2 msaitoh if [ -f /etc/ntp.conf ]
82 1.1.1.1.28.2 msaitoh then
83 1.1.1.1.28.2 msaitoh /bin/echo " setting tick and tickadj..."
84 1.1.1.1.28.2 msaitoh /usr/local/etc/tickadj -t 16672 -a 54
85 1.1.1.1.28.2 msaitoh sleep 5
86 1.1.1.1.28.2 msaitoh /bin/echo " starting xntpd..."
87 1.1.1.1.28.2 msaitoh /usr/local/etc/xntpd <&- > /dev/null 2>&1
88 1.1.1.1.28.2 msaitoh sleep 5
89 1.1.1.1.28.2 msaitoh fi
90 1.1.1.1.28.2 msaitoh #
91 1.1.1.1.28.2 msaitoh fi
92 1.1.1.1.28.2 msaitoh
93 1.1.1.1.28.2 msaitoh echo "Leaving rc.local..."
94 1.1.1.1.28.2 msaitoh
95 1.1.1.1.28.2 msaitoh There are a few things to notice about the above:
96 1.1.1.1.28.2 msaitoh
97 1.1.1.1.28.2 msaitoh o When run, 'ntpdate' forces your clock to the time returned by the
98 1.1.1.1.28.2 msaitoh host(s) specified by <host.domain> (you'll need to replace this
99 1.1.1.1.28.2 msaitoh be the IP address(es) of your timehosts. This is good since it gets
100 1.1.1.1.28.2 msaitoh things close to start off with. You can use more than one time
101 1.1.1.1.28.2 msaitoh server.
102 1.1.1.1.28.2 msaitoh
103 1.1.1.1.28.2 msaitoh o 'tickadj' is also called. This does two things: changes the
104 1.1.1.1.28.2 msaitoh default value of 'tick' (which the the amount of time, in ms, that
105 1.1.1.1.28.2 msaitoh is added to the clock every 1/60 seconds) and changes the value
106 1.1.1.1.28.2 msaitoh of 'tickadj' which the the amount that is added or subtracted
107 1.1.1.1.28.2 msaitoh from 'tickadj' when adjtime() is called.
108 1.1.1.1.28.2 msaitoh
109 1.1.1.1.28.2 msaitoh Now Mac clocks are pretty bad and tend to be slow. Sooo, instead of
110 1.1.1.1.28.2 msaitoh having A/UX add the default of 16666ms every 1/60th of a second, you
111 1.1.1.1.28.2 msaitoh may want it to add more (or less) so that it keeps better time. The
112 1.1.1.1.28.2 msaitoh above value works for me but your "best" value may be different and
113 1.1.1.1.28.2 msaitoh will likely require some fooling around to find the best value. As a
114 1.1.1.1.28.2 msaitoh general rule of thumb, if you see 'xntpd' make a lot of negative clock
115 1.1.1.1.28.2 msaitoh adjustments, then your clock is fast and you'll need to _decrease_
116 1.1.1.1.28.2 msaitoh the value of 'tick'. If your adjustments are positive, then you need
117 1.1.1.1.28.2 msaitoh to increase 'tick'. To make a guess on how fast/slow your clock is,
118 1.1.1.1.28.2 msaitoh use 'ntpdate' to sync your clock. Now watch 'xntpd' and see how it
119 1.1.1.1.28.2 msaitoh operates. If, for example, it resets your clock by 1 second every 30
120 1.1.1.1.28.2 msaitoh minutes, then your clock is (1/(30*60)) is about 0.056% off and you'll
121 1.1.1.1.28.2 msaitoh need to adjust 'tick' by 16666*0.00056 or about 9 (i.e. 'tick' should
122 1.1.1.1.28.2 msaitoh be ~16675 if slow or ~16657 if fast)
123 1.1.1.1.28.2 msaitoh
124 1.1.1.1.28.2 msaitoh A/UX's default value of 'tickadj' is 1666 which is too big for
125 1.1.1.1.28.2 msaitoh 'xntpd'... so it also needs to be adjusted. I like using larger
126 1.1.1.1.28.2 msaitoh values then the recommended value of 9 for 'tickadj' (although not
127 1.1.1.1.28.2 msaitoh anything near as big as 1666) since this allows for quick slews
128 1.1.1.1.28.2 msaitoh when adjusting the clock. Even with semi-large values of 'tickadj'
129 1.1.1.1.28.2 msaitoh (~200), getting 5ms (1/200 s) accuracy is easy.
130 1.1.1.1.28.2 msaitoh
131 1.1.1.1.28.2 msaitoh
132 1.1.1.1.28.2 msaitoh Finally, before A/UX and 'xntpd' will work happily together, you need to
133 1.1.1.1.28.2 msaitoh patch the kernel. This is due to the fact that A/UX attempts to keep the
134 1.1.1.1.28.2 msaitoh UNIX-software clock and the Mac-hardware clock in sync. Neither the h/w or
135 1.1.1.1.28.2 msaitoh the s/w clock are too accurate. Also, 'xntpd' will be attempting to adjust
136 1.1.1.1.28.2 msaitoh the software clock as well, so having A/UX muck around with it is asking
137 1.1.1.1.28.2 msaitoh for headaches. What you therefore need to do is tell the kernel _not_ to
138 1.1.1.1.28.2 msaitoh sync the s/w clock with the h/w one. This is done using 'adb'. The
139 1.1.1.1.28.2 msaitoh following is a shell script that will do the patch for you:
140 1.1.1.1.28.2 msaitoh
141 1.1.1.1.28.2 msaitoh #! /bin/sh
142 1.1.1.1.28.2 msaitoh adb -w /unix <<!
143 1.1.1.1.28.2 msaitoh init_time_fix_timeout?4i
144 1.1.1.1.28.2 msaitoh init_time_fix_timeout?w 0x4e75
145 1.1.1.1.28.2 msaitoh init_time_fix_timeout?4i
146 1.1.1.1.28.2 msaitoh $q
147 1.1.1.1.28.2 msaitoh !
148 1.1.1.1.28.2 msaitoh
149 1.1.1.1.28.2 msaitoh This must be done _every_ time you create a new kernel (via newconfig or
150 1.1.1.1.28.2 msaitoh newunix) or else 'xntpd' will go crazy.
151 1.1.1.1.28.2 msaitoh
152 1.1.1.1.28.2 msaitoh --------
153 1.1.1.1.28.2 msaitoh HISTORY:
154 1.1.1.1.28.2 msaitoh --------
155 1.1.1.1.28.2 msaitoh
156 1.1.1.1.28.2 msaitoh John Dundas was the original porter of 'xntpd' and a lot of the additions
157 1.1.1.1.28.2 msaitoh and A/UX-ports are from him. I got involved when I wanted to run 'xntpd'
158 1.1.1.1.28.2 msaitoh on jagubox. It was also around this time that the base-patchlevel of
159 1.1.1.1.28.2 msaitoh 'xntpd' changed relatively (the so-called "jones" version). Since then,
160 1.1.1.1.28.2 msaitoh I've been maintaining 'xntpd' for A/UX for the xntp development team
161 1.1.1.1.28.2 msaitoh
162 1.1.1.1.28.2 msaitoh The original kernel patch (which patched 'time_fix_timeout') was from
163 1.1.1.1.28.2 msaitoh Richard Todd. I suggest patching 'init_time_fix_timeout' which prevents
164 1.1.1.1.28.2 msaitoh 'time_fix_timeout' from even being called.
165 1.1.1.1.28.2 msaitoh
166 1.1.1.1.28.2 msaitoh ----------------
167 1.1.1.1.28.2 msaitoh TECHNICAL NOTES:
168 1.1.1.1.28.2 msaitoh ----------------
169 1.1.1.1.28.2 msaitoh
170 1.1.1.1.28.2 msaitoh o As configured (see machines/aux3), 'xntpd' will log messages via syslogd
171 1.1.1.1.28.2 msaitoh using the LOC_LOCAL1 facility. I would suggest the following in
172 1.1.1.1.28.2 msaitoh /etc/syslog.conf:
173 1.1.1.1.28.2 msaitoh
174 1.1.1.1.28.2 msaitoh local1.notice /usr/adm/ntpd-syslog
175 1.1.1.1.28.2 msaitoh
176 1.1.1.1.28.2 msaitoh o As mentioned above, the clocks on A/UX and Macs are kinda bad. Not
177 1.1.1.1.28.2 msaitoh only that, but logging in and out of the MacOS mode as well as
178 1.1.1.1.28.2 msaitoh extensive floppy use causes A/UX to drop and lose clock interupts
179 1.1.1.1.28.2 msaitoh (these are sent every 1/60th of a second). So, if you do these
180 1.1.1.1.28.2 msaitoh activities a lot, you find out that you lose about 300ms of time
181 1.1.1.1.28.2 msaitoh (i.e., you become 300ms slow). 'xntpd' default way of handling this
182 1.1.1.1.28.2 msaitoh is to called 'settimeofday()' and step the clock to the correct
183 1.1.1.1.28.2 msaitoh time. I prefer having 'xntpd' slew the clock back into line by
184 1.1.1.1.28.2 msaitoh making gradual adjustments to the clock over a coupla minutes
185 1.1.1.1.28.2 msaitoh or so. It's for this reason that SLEWALWAYS is defined in
186 1.1.1.1.28.2 msaitoh include/ntp_machine.h for SYS_AUX3. It's also for this reason than
187 1.1.1.1.28.2 msaitoh I like larger values of 'tickadj'.
188 1.1.1.1.28.2 msaitoh
189 1.1.1.1.28.2 msaitoh Good luck! If you have problems under A/UX feel free to contact me (e-mail
190 1.1.1.1.28.2 msaitoh is preferred).
191 1.1.1.1.28.2 msaitoh --
192 1.1.1.1.28.2 msaitoh Jim Jagielski | "That is no ordinary rabbit... 'tis the
193 1.1.1.1.28.2 msaitoh jim (a] jagubox.gsfc.nasa.gov | most foul, cruel and bad-tempered
194 1.1.1.1.28.2 msaitoh NASA/GSFC, Code 734.4 | rodent you ever set eyes on"
195 1.1.1.1.28.2 msaitoh Greenbelt, MD 20771 | Tim the Enchanter
196