Subject: (4.3) How does it all fit together? |
---|
Here is a fantastic overview of the workings of INN. From: Ken Hornstein <kenh@leps5.phys.psu.edu> I discovered that the biggest problem I had with INN was understanding how everything fits together (since I had no experience with B or C news). Here's a (hopefully) simple description of how everything fits together: After running rc.news (as "root"), you should have the "innd" daemon running ("ps" will show the process to be owned by "news"). This is the Master Daemon. It handles incoming connections, stores the articles on your disk, but does _not_ send any articles out itself. It directs other programs to do that. Exactly where articles are sent and how they are sent is determined by the "newsfeeds" file. Setting up your newsfeeds file will be the hardest part of configuring INN. Here are some example entries from my newsfeeds file: ra/ra.nrl.navy.mil\ :*,!psu.*/!psu\ :Tf,Wnm:Looks complicated? It isn't. Here's what it means: "ra" is the name of the feed. "/ra.nrl.navy.mil" is an alias for ra. This is important because INN uses the "Path" header to insure the articles are not sent to sites where they have already been. Thus, any article that has "ra" or "ra.nrl.navy.mil" in the Path header will NOT be sent to this site. We know that no other site inserts "ra.nrl.navy.mil" because it is a FQDN (Fully Qualified Domain Name). We know that no other site inserts "ra" because it is registered in the UUCP Maps. (Ok, "ra" isn't registered so I'm just taking a small gamble.) The second line tells what articles will be sent out to this site. "*,!psu.*" means that articles for (all newsgroups minus those that match "psu.*") will be sent to ra. The details of the pattern matching is found in the wildmat(3) man page. The "/!psu" means that articles with a "Distribution" header of psu will also not be sent to ra. The last field specifies exactly what _kind_ of feeds. "Tf" means this is a file feed. Unless you have unusual requirements, all of your feeds will be file feeds. "Wnm" means that the relative path name and the Message-ID of the article will be written to this file. The "n" means "relative path name", the "m" means "Message-ID of the article". The newsfeeds(5) man page explains all the letters you can use with "W". By default, the output file is called the same name as your feed file, and is in your out.going directory. So on my system, every article destined to ra will have its filename and Message-ID written to the file "/var/spool/news/out.going/ra". So how do the articles actually GET to ra? You run a program that reads the feeds file and transmits the article. Two such programs are included with INN -- "send-nntp" and "nntpsend". My personal preference is for nntpsend. If you are going to use nntpsend, you will need to add a similar line to your nntpsend.ctl file: ra:ra.nrl.navy.milThis tells nntpsend that articles in the feed file "ra" should be sent to the site "ra.nrl.navy.mil". I run nntpsend out of cron every 10 minutes with this line: (in "news"'s cron) 0,10,20,30,40,50 * * * * /usr/local/news/bin/nntpsendOr, if you use an old-style cron (like Ultrix does): 0,10,20,30,40,50 * * * * /bin/su news -c '/usr/local/news/bin/nntpsend'UUCP feeds work similarly and are described in a different section. As each article comes in (note that hosts feeding you _must_ be listed in the hosts.nntp file), innd will examine it and distribute to your listed feeds based on the above-described selection criteria. Another important thing to do is to make sure your articles get expired. This is done from the "news.daily" script. The "expire.ctl" file describes how long you want each article to last. Here are some sample lines from my expire.ctl: /remember/:14This line tells expire to keep history entries for articles at least 14 days. *:A:1:7:21This is the default line. This says that by default, an article is kept a minimum of one day, the default expiration time is 7 days (this applies if there is no "Expires" header), and the very maximum that the article is kept is 21 days. psu.*:A:1:14:28This line applies to groups only in Penn State. By default, those articles will last 14 days, 28 days at the most. Note that lines in expire.ctl should have the most general entries first, with the most specific entries last. Lastly, where do newsreaders fit in? When a newsreader connects to the innd process, it sees that this is not a feeder (the hosts.nntp file lists only sitest that feed YOU) so it forks a nnrpd process and hands the connection to it. This way innd can concentrate on newsfeeds. Some newsreaders don't open a connection, but instead read the articles out of "/usr/spool/news" (and gets meta data from "/usr/lib/news"). INN doesn't need to do anything about those readers except to make sure the right data is where they expect it. ------------------------------ [Last Changed: $Date: 1997/08/26 01:26:21 $ $Revision: 2.19 $] [Copyright: 1997 Heiko Rupp, portions by Tom Limoncelli, Rich Salz, et al.] |