                           Installing controlchan

1. INSTALL THE SCRIPTS

   - Copy bin/controlchan and bin/controlbatch to your newsbin
     directory (where innd itself lives).  Set it so that the news
     account can read and execute.

   - Copy bin/control/*.pl to your bin/control directory.  Make sure
     that the news account has read permission for the new scripts;
     execution permission helps for testing too.

   - controlchan will need one small change.  Find the line near the
     top that reads

       require "/news/lib/innshellvars.pl" ;

     and set it so that it points to the location of innshellvars.pl on
     your system.

   - A similar change will be needed in controlbatch.  Change the line
     that reads
     
       . /news/lib/innshellvars
     
     to match the location of innshellvars on your system.  Yes, the
     dot is important.

   - To test, you can run each script at the shell prompt, and there
     should be no error messages.  (You will need to press ^D to exit
     from controlchan.)


2. MAKE SURE YOU HAVE CANCELS FILED SEPARATELY

   VERY IMPORTANT:  On some INN installations, there is only a single
   newsgroup called control.  Take a moment to make a separate cancel
   group, by entering this command:
   
       	ctlinnd newgroup control.cancel

   If you don't do this, controlchan will have to scan through all the
   cancels, causing masses of unnecessary overhead.
   
   If control.cancel exists, innd will automatically start using it.


3. ADD A NEWSFEED (pick one):

   A. CHANNEL OPERATION

      - You will need a new entry in newsfeeds to direct control messages
        to controlchan:

          controlchan!\
            :!*,control,control.*,!control.cancel\
            :Tc,Wnsm:/news/bin/controlchan

      - Remember to change /news/bin/controlchan to match the actual
        directory where controlchan resides.
      
      - You may want to do a nightly clean up, in case the channel ever
        falls behind and leaves a feed file:
         
          00 04 * * *     /news/bin/controlbatch
   

   B. FILE OPERATION
   
      - If you don't want to process control messages in real time, use
        this feed entry instead:

          controlchan!\
            :!*,control,control.*,!control.cancel\
            :Tf,Wnsm:
      
      - And, add something like this to your crontab:
     
          30 * * * *     /news/bin/controlbatch


4. PATCH INN

   I've not included a patch file because the location and precise
   appearance of this block of code may vary.  In innd/art.c, look for
   this section:

   :  /* Build the command vector and execute it. */
   :  av[0] = buff;
   :  av[1] = COPY(Data->Poster);
   :  av[2] = COPY(Data->Replyto);
   :  av[3] = Data->Name;
   :  av[4] = (char *)Data->Feedsite;
   :  av[5] = NULL;
   :  HeaderCleanFrom(av[1]);
   :  HeaderCleanFrom(av[2]);
   :  if (Spawn(STDIN, (int)fileno(Errlog), (int)fileno(Errlog), av) < 0)
   :      /* We know the strrchr below can't fail. */
   :      syslog(L_ERROR, "%s cant spawn %s for %s %m",
   :          LogName, MaxLength(av[0], strrchr(av[0], '/')), Data->Name);
   :  DISPOSE(av[1]);
   :  DISPOSE(av[2]);

   Disable this block of code by placing

     #ifdef 0

   at the top, and

     #endif

   at the bottom.

   Now you'll need to BUILD (INN 1.7) or make (INN 2.x) to create the
   updated innd.


5. SYSLOGGING

   Controlchan can use syslog for logging; it will log with the 'news'
   facility, with most messages at 'notice' level.  If you want to use
   this, you will need to have run 'h2ph' on your system include files
   at some point (this is required to make Sys::Syslog work).  If you
   have not done so, do this:

       cd /usr/include
       h2ph *

   If you do not want to try to use syslogging, comment out the eval
   line near the top that tries to load Sys::Syslog.

   If Sys::Syslog fails to work, controlchan should keep running, and
   use stdout (usually 'errlog') for its messages.


6. CHANGING, ADDING, REMOVING SCRIPTS
   
   I do recommend keeping the shell scripts and parsecontrol around for
   at least a while, since this is all new to INN.  To disable any of
   the new scripts, simply move them out of the control directory.  The
   command 'ctlinnd flush controlchan' will tell the program to reload
   the control message list.
   
   If you make any changes to the *.pl scripts, test them for validity
   before you flush the channel.  'perl -cw scriptname.pl' should
   report that there are no errors (singly-defined $inn::* variables
   are normal).
