Installing and Maintaining an INN News Server

  1. Make sure your ISP is sending you a newsfeed with the desired groups. Most ISPs will help T1 customers only during the first month of service.
  2. Get inn from ftp.isc.org/isc.inn and untar it someplace (preferably on a computer).
  3. ./config
  4. make
  5. make install - This will create the 'news' user and appropriate directories.
  6. su news
  7. Make sure /sbin/init.d/inn is started at bootup by changing /etc/rc.config to START_INN="yes" (this is for SuSE linux - other versions may use a different method, such as adding a startup script named "inn" in /etc/init.d and then creating a link to it in /etc/init.d/rc3.d, i.e. S99inn -> ../inn).
  8. Copy the files "active" and "newsgroups" from ftp.isc.org/pub/usenet/config. Put the files in /var/lib/news.
  9. Edit /var/lib/news/active to contain the desired groups, e.g.:
       control 0000000000 0000000000 y
       control.cancel 0000000000 0000000000 y
       junk 0000000000 0000000000 y 
    You must have at least the groups "control" and "control.cancel".
  10. Edit /etc/news/inn.conf to add "Organization" and server to match your organization and local news server. For example:
       organization:    Institute for the Advancement of Niceness
       server:          fluffy.ian.org     
  11. Edit /etc/news/incoming.conf and add the name of the ISP's servers that are feeding you news. There may be a number of these. For example:
       peer uunet {
           hostname: news1234.news.uu.net
       }
       peer uunet {
           hostname: nntp-out1.uu.net
       }  
  12. Edit /etc/news/newsfeeds. It needs entries for 'ME' , controlchan, and one specifically provided by your ISP to allow your site to post.
       ME:!control*,!junk,!local*::
       controlchan!:!*,control,control.*,!control.cancel\
              :Tc,Wnsm:/usr/lib/news/bin/controlchan
       ABCDE.inbound.news.uu.net:*,!junk,!control*:Tf,Wnm:ABCDE.inbound.news.uu.net   
    where ABCDE.inbound.news.uu.net is your account name given by your ISP.
  13. Edit /etc/news/nntpsend.ctl and add the line:
       uunet:ABCDE.inbound.news.uu.net:10m:-t180   
    This contains the account name provided by your ISP and various parameters to control when posts are sent.
  14. Edit /etc/news/expire.ctl. This file controls how long posts are retained on your server before expiring. For example:
       ##  If article expires before 14 days, we still remember it for 14 days in
       ##  case we get offered it again.  Depending on what you use for the innd
       /remember/:14
    
       ##  Keep for 1-10 days, allow Expires headers to work.
       ##  Groups:Types:minimum:default:maximum
       *:A:10:14:18
    
       ##  Some particular groups stay forever.
       # Keep FAQ's for a month, so they're always available
       # in case anyone ever wants to read it.
       *.answers:M:1:35:90
       news.announce.*:M:1:35:90
       bionet.molbio.methds-reagnts:A:never:never:never   
  15. See linuxsetup58.html for more details on inn, including the procedure for upgrading to the new inn and re-building the 'overview' files.
  16. Add the following to news's crontab:
       15 0 * * *      /usr/lib/news/bin/news.daily expireover lowmark delayrm
       10 * * * *      rnews -U   
    This is important to make sure the articles get expired. Check the free disk space on the server frequently until it stabilizes. A news server will take a couple of gigabytes of space. For example, we had to make /var/spool/news/ a link to /usr/spool2/news/, because /var was on a small partition. Our small news spool, with less than 100 useful groups, takes over 1.5 GB. Obviously, make sure innd is not running when you move things.

Adding new groups

New groups will be added by your ISP automatically from time to time. Most of these will be undesirable groups with annoying names. Make sure you know what groups have been added so you can explain to management why your site is receiving posts from groups like news.free.uk.mad.alien.sheep.on.drugs.discussing.politics.

Also, never edit the "active" file while the news server is running - it will get corrupted. You must use ctlinnd to make changes.

  1. Pause the news server. Alternatively, shut it down in /etc/init.d.
      cd /usr/lib/news/bin
      ./ctlinnd pause 'edit active'   
    (it should say "Ok"). The pause command automatically flushes it so there is no need to type
     ./ctlinnd flush 
  2. Add the new group. There are two ways to do this:
    1.  cd /var/lib/news 
      Then edit /var/lib/news/active to add new groups. For example, add the line:
       sci.military.bloopers.tactical-nukes 0000000000 0000000001 y 
      There is no need to create new subdirectories.
    2. Alternatively, add them one at a time using ctlinnd:
       ./ctlinnd newgroup alt.sex.hamsters.pictures.binary y abcd 
      where abcd are your initials. This method is preferable because the addition is confirmed in the logs. The server should now accept the new groups from your ISP if they are being sent.
  3. Finally, check everything and restart the news server.
      cd /usr/lib/news/bin
     ./inncheck
     ./ctlinnd go 'edit active' 

Changing the newsfeed

UUNET has a very specific and detailed procedure for requesting changes in the newsfeed which is apparently handled by custom software.

Restarting innd after upgrading the system

Typically, /var/spool/news is not backed up because of its size and so the messages are lost when the system is upgraded. To re-start news, do the following:

  1. /etc/rc.d/inn stop
  2. Restore the configuration files in /etc/news and /var/lib/news, including the history .
  3. Rebuild history database
          /usr/lib/news/bin/makehistory -O -b 
          /usr/lib/news/bin/news.daily expireover lowmark delayrm
          rnews -U     
  4. /usr/bin/perl /usr/lib/news/bin/inncheck
  5. chown -R news.news /var/spool/news (In Solaris, replace the dot by a colon (':')).
  6. chown -R news.news /var/lib/news
  7. /etc/rc.d/inn start
  8. If innd sends messages to syslog like
         cant write alt.fetish.sockpuppets/174192 No such file or directory
    it means that 'news' does not have write permission in /var/spool. Rebuilding the directory structure manually (by parsing the active file and using mkdir) or using ctlinnd (in a looping shell script) should not be necessary and will create problems if new groups are added later unless the permissions are fixed. These directories are normally created automatically by innd.
  9. Be sure to check your email as well as the system logs and in /var/lib/*err*. The news server puts its error messages in a variety of locations to make life interesting.

Problems

Occasionally the overview database will get corrupted. This can be caused by improper shutdowns, running out of disk space, or running out of inodes. For example, if the computer runs out of memory, linux will randomly start terminating programs, corrupting your database. The symptom is that inn continues to run but doesn't accept any articles. Users get a "throttling" message and are unable to connect.
The logs show messages like the following:

  Jul  4 00:17:54 engram innd: localhost:13 closed seconds 0 accepted 0 refused 0 rejecte
  Jul  4 00:20:10 engram innd: localhost:13 closed seconds 0 accepted 0 refused 0 rejecte
  Jul  4 01:15:11 engram innd: tradspool: could not open /var/spool/news/alt/test/1716803
  Jul  4 01:15:11 engram innd: SERVER cant store article: File exists

Checking status with innstat gives the following:

  # /usr/lib/news/bin/innstat
  Server status:
  Server throttled File exists writing SMstore file -- throttling
  Parameters c 14 i 50 (0) l 5000000 o 1011 t 300 H 2 T 60 X 0 normal specified
  Not reserved
  Readers follow disabled File exists writing SMstore file -- throttling

To fix this, stop innd and type

  su news
  cd /var/lib/news
  rm history*
  cd /usr/lib/news/bin
  ./makehistory -b -O -F
  

This will rebuild the history file and delete any "bad" articles. Then cd to /var/lib/news (or whatever directory is specified in pathdb in /etc/news/inn.conf) and type

  wc -l < history
  /usr/lib/news/bin/makedbz -s 12345 -o 

where 12345 is the number of lines in the history file. Then restart inn and watch the logs to make sure it can store articles. If this doesn't work, you may need to delete and re-create your overview files (see linuxsetup58.html). This is necessary, for example, if you're using "buffindexed" (in your /etc/news/inn.conf).

  inn.conf:ovmethod:              "buffindexed" 

If this still doesn't work, try the following:

  1. Double-check all the history and overview files to make sure they're owned by news.news.
  2. rm tradspool.map
  3. As a last resort, use rm -rf on some of the /var/spool/news to get rid of all the articles and rebuild the databases again. (Don't remove the incoming, outgoing, control, or overview directories).

For further information

More information is available at www.blank.org/innfaq.

Typical log entries when innd is started
    PAM-unix2[4524]: session started for user news, service su 
    inndstart: Reading config from /etc/news/inn.conf
    actived[4551]: Reading config from /etc/news/inn.conf
    actived[4552]: started
    innd: Reading config from /etc/news/inn.conf
    innd: SERVER descriptors 1024
    innd: SERVER outgoing 1011
    innd: SERVER ccsetup control:11
    innd: SERVER lcsetup localconn:13
    innd: SERVER rcsetup remconn:4
    innd: SERVER cant gethostbyname [ISP servername] No such file or directory
    innd: SERVER cant gethostbyname [ISP servername] No such file or directory
    overchan[4555]: Reading config from /etc/news/inn.conf
    innd: overview! spawned overview!:16:proc:4555
    innd: controlchan! spawned controlchan!:17:proc:4556
    innd: [ISP's inbound servername] opened [ISP's inbound servername]:15:file
    innd: SERVER perl filtering enabled
    innd: SERVER starting
    controlchan[4556]: starting 
    controlchan[4556]: loaded $inn::controlprogs/sendme.pl 
    controlchan[4556]: loaded $inn::controlprogs/newgroup.pl 
    controlchan[4556]: loaded $inn::controlprogs/checkgroups.pl 
    controlchan[4556]: loaded $inn::controlprogs/sendsys.pl 
    controlchan[4556]: loaded $inn::controlprogs/rmgroup.pl 
    controlchan[4556]: loaded $inn::controlprogs/senduuname.pl 
    controlchan[4556]: loaded $inn::controlprogs/ihave.pl 
    controlchan[4556]: loaded $inn::controlprogs/version.pl 
    ...
    innd: [ISP's servername] connected 19 streaming allowed
    innd: [ISP's servername]:19 NCmode "mode stream" received
    innd: [ISP's servername]:19 closed seconds 45 accepted 41 
       refused 0 rejected 23 


Back