home *** CD-ROM | disk | FTP | other *** search
/ PC-Online 1996 May / PCOnline_05_1996.bin / linux / source / n / bind / bind-4.001 / bind-4~ / bind-4.9.3-BETA9 / contrib / ninit / README < prev   
Text File  |  1991-05-13  |  3KB  |  90 lines

  1.              NINIT -- NAMED INIT PROGRAM
  2.                  May 13, 1991
  3.  
  4. WHAT NINIT DOES
  5. ===============
  6.  
  7. ninit starts named in nofork mode and waits for it to exit.  When it
  8. exits, ninit restarts a new named.  In addition, every 5 minutes,
  9. ninit wakes up and sends a SIGIOT to named.  This causes named to dump
  10. statistical information to /usr/tmp/named.stats.  Every 60 seconds,
  11. ninit tries to do a name resolution using the local named.  If it
  12. fails to get an answer back in some short amount of time, it kills the
  13. existing named and starts a new one.
  14.  
  15. We are running this on the MIT nameservers and our mailhub.  We find
  16. that ninit is extremely useful in catching named's that die mysteriously,
  17. or which get hung for some unknown reason.  It's especially useful on our
  18. mailhub, since our mail queue will explode if we lose name resolution
  19. even for a short time.  
  20.  
  21. MODIFICATIONS TO NAMED
  22. ======================
  23.  
  24. In order to use ninit, you will need to modify your named so that it
  25. understands the -n flag, which tells it not to fork upon startup.  The
  26. patch to do that can be found in ns_main.c.patch.  
  27.  
  28. If you don't have source code to your named, you can also solve the
  29. problem by adding the #define FORKING_NAMED.  This solves the problem
  30. by starting the named with the -d option, which tells named not to
  31. fork, but which also tells it to start a debugging log in
  32. /usr/tmp/named.run.  As soon as the the named is finished
  33. initializing, ninit will send a SIGUSR1 signal to tell it to turn off
  34. debugging.  (It can't send the signal before that because the signal
  35. handlers aren't established before that point.)  The down side of this
  36. is that named will be writing debugging information while it is
  37. initializing itself.  
  38.  
  39. I would suggest modifying named if you have the source.  If you don't
  40. FORKING_NAMED will work --- it's an ugly solution, though.
  41.  
  42. HOW TO INSTALL NINIT
  43. ====================
  44.  
  45. 1)  Edit ninit.c and check the configuration options near the
  46. beginning of the file.  You will almost certainly need to change
  47. TEST_HOST.  You may or may not need to change the configuration
  48. variables.
  49.  
  50. 2) Compile ninit and place the executable in /etc.
  51.  
  52. 3) Pick a port for the "nstats" service and install it in /etc/services.
  53. Modify the named_stats script to use the port number you've picked as the 
  54. $default_nstats_port.
  55.  
  56. 5) Add the following line /etc/inetd.conf
  57.  
  58. nstats stream tcp nowait unswitched daemon /bin/cat   cat /usr/tmp/named.stats
  59.  
  60. 6) Modify /etc/rc so that it starts /etc/ninit instead of /etc/named
  61. upon reboot.
  62.  
  63. 7) As root, run /etc/ninit.  It will kill off the existing named and
  64. run a new named under its control.
  65.  
  66. If you like, you may wish to edit /etc/syslog.conf to direct the ninit
  67. logging information to a logfile, or to some centeral logging host, or
  68. wherever you choose.
  69.  
  70. You will also need to modify named_stats so that it checks whatever
  71. hosts you desire.
  72.  
  73. BUGS
  74. ====
  75.  
  76.     None known.  (Yet!)
  77.  
  78.     If you find any problems, please let me know:
  79.  
  80.         Theodore Ts'o
  81.         tytso@mit.edu.
  82.  
  83. I hope you find ninit useful!
  84.  
  85. Theodore Ts'o
  86. May 13, 1991.
  87.  
  88.  
  89.     
  90.