/contrib/ntp/html/build/hints/a-ux

https://bitbucket.org/freebsd/freebsd-head/ · #! · 195 lines · 158 code · 37 blank · 0 comment · 0 complexity · 7e17d1f952385a4751ff9f78497e0779 MD5 · raw file

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