Batching is the term used to describe sending large bundles of individual articles all in one transmission. When batching is enabled for a given site, C News does not send any incoming article immediately; instead, it appends its path name to a file, usually called out.going/site/togo . Periodically, a program is executed from a crontab entry by the cron program, which reads this file and bundles all of the listed articles into one or more file, optionally compressing them and sending them to rnews at the remote site. [125] Note that this should be the crontab of news; file permissions will not be mangled.
Figure 21.1 shows the news flow through relaynews. Articles may be relayed to the local site (denoted by ME ), to a site named ponderosa via email, and a site named moria , for which batching is enabled.
Figure 21.1: News flow through relaynews
C News should be available in a prepackaged format for any modern Linux distribution, so installation will be easy. If not, or if you want to install from the original source distribution, then of course you can. [126] You can obtain the C News source distribution from its home site at ftp.cs.toronto.edu /pub/c-news/c-news.tar.Z
No matter how you install it, you will need to edit the C News configuration files. Their formats are described in the following list:
sys
The sys file controls which newsgroups your site receives and forwards. We discuss it in detail in the following section.
active
Not usually edited by the administration; contains directions for handling articles in each newsgroup the site handles.
organization
This file should contain your organization's name, for example, "Virtual Brewery, Inc." On your home machine, enter "private site," or anything else you like. Most people will not consider your site properly configured if you haven't customized this file.
newsgroups
This file is a list of all newsgroups, with a one-line description of each one's purpose. These descriptions are frequently used by your newsreader when displaying the list of all groups to which you are subscribed.
mailname
Your site's mail name, e.g., vbrew.com .
whoami
Your site's name for news purposes. Quite often, the UUCP site name is used, e.g., vbrew .
explist
You should probably edit this file to reflect your preferred expiration times for special newsgroups. Disk space may play an important role in your choices.
To create an initial hierarchy of newsgroups, obtain active and newsgroups files from the site that feeds you. Install them in /etc/news , making sure they are owned by news and have a mode of 644, using the chmod command. Remove all to.* groups from the active file, and add to.my-site, to.feed-site, junk, and control. The to.* groups are normally used for exchanging ihave/sendme messages, but you should list them regardless of whether you plan to use ihave/sendme or not. Next, replace all article numbers in the second and third field of active using the following commands:
# cp active active.old
# sed 's/ [0-9]* [0-9]* / 0000000000 00001 /' active.old › active
# rm active.old
The second command invokes the sed stream editor. This invocation replaces two strings of digits with a string of zeroes and the string 000001, respectively.
Finally, create the news spool directory and the subdirectories used for incoming and outgoing news:
# cd /var/spool
# mkdir news news/in.coming news/out.going news/out.master
# chown -R news.news news
# chmod -R 755 news
If you're using precompiled newsreaders sourced from a different distribution to the C News server you have running, you may find that some expect the news spool in /usr/spool/news rather than /var/spool/news . If your newsreader doesn't seem to find any articles, create a symbolic link from /usr/spool/news to /var/spool/news like this:
# ln -sf /usr/spool/news /var/spool/news
Now you are ready to receive news. Note that you don't have to create the individual newsgroup spool directories. C News automatically creates spool directories for any newsgroup it receives an article for, if one doesn't already exist.
In particular, this happens to all groups to which an article has been cross-posted. So, after a while, you will find your news spool cluttered with directories for newsgroups you have never subscribed to, like alt.lang.teco. You may prevent this by either removing all unwanted groups from active , or by regularly running a shell script that removes all empty directories below /var/spool/news (except out.going and in.coming , of course).
C News needs a user to send error messages and status reports to. By default, this is usenet . If you use the default, you have to set up an alias for it that forwards all of its mail to one or more responsible person. You may also override this behavior by setting the environment variable NEWSMASTER to the appropriate name. You have to do so in news 's crontab file, as well as every time you invoke an administrative tool manually, so installing an alias is probably easier. Mail aliases are described in Chapter 18, Sendmail, and Chapter 19, Getting Exim Up and Running.
While you're hacking /etc/passwd , make sure that every user has her real name in the pw_gecos field of the password file (this is the fourth field). It is a question of Usenet netiquette that the sender's real name appears in the From: field of the article. Of course, you will want to do so anyway when you use mail.
The sys file, located in /etc/news , controls which hierarchies you receive and forward to other sites. Although there are maintenance tools named addfeed and delfeed, we think it's better to maintain this file by hand.
The sys file contains entries for each site to which you forward news, as well as a description of the groups you will accept. The first line is a ME entry that describes your system. It's a safe bet to use the following:
ME:all/all::
You also have to add a line for each site to which you feed news. Each line looks like this:
site [/ exclusions ]: grouplist [/ distlist ][: flags [: cmds ]]
Entries may be continued across newlines using a backslash ( \ ) at the end of the line to be continued. A hash sign ( # ) denotes a comment.
site
This is the name of the site the entry applies to. One usually chooses the site's UUCP name for this. There has to be an entry for your site in the sys file too, or you will not receive any articles yourself.
The special site name ME denotes your site. The ME entry defines all groups you are willing to store locally. Articles that aren't matched by the ME line will go to the junk group.
C News rejects any articles that have already passed through this site to prevent loops. C News does this by ensuring that the local site name does not appear in the Path: of the article. Some sites may be known by a number of valid names. For example, some sites use their fully qualified domain name in this field, or an alias like news. site.domain . To ensure the loop prevention mechanism works, it is important to add all aliases to the exclusion list, separating them by commas.
Читать дальше