threading, because the time required for this is proportional to the square of the number of articles.

We will not go into how the user interfaces are built here. All newsreaders currently available for Linux have a good help function; please refer to it for more details.

In the following sections, we will deal only with administrative tasks. Most of these relate to the creation of threads databases and accounting.

tin Configuration

The most versatile newsreader with respect to threading is tin. It was written by Iain Lea and is loosely modeled on an older newsreader named tass (written by Rich Skrenta). It does its threading when the user enters the newsgroup, and it is pretty fast unless you're getting posts via NNTP.

On a 486DX50, it takes roughly 30 seconds to thread 1,000 articles when reading directly from disk. It would take more than 5 minutes over NNTP to reach a loaded news server. [140] You may improve this time by regularly updating your index file by invoking tin with the - u option, so that when you next start tin to read news the threads already exist. Alternatively, you can invoke tin with the -U option to read news. When invoked this way, tin forks a background process to build the index files while you are reading news.

Usually, tin dumps its threading databases in the user's home directory below .tin/index. This may be costly in terms of resources, however, so you should keep a single copy of them in a central location. This may be achieved by making tin setuid to news, for example. tin will then keep all thread databases below /var/spool/news/.index. For any file access or shell escape, it will reset its effective uid to the real uid of the user who invoked it.[141]

The version of tin included in some Linux distributions is compiled without NNTP support, but most do have it now. When invoked as rtin or with the -r option, tin tries to connect to the NNTP server specified in the file /etc/nntpserver or in the NNTPSERVER environment variable. The nntpserver file simply contains the server's name on a single line.

trn Configuration

trn is also the successor to an older newsreader, namely rn (which means read news). The 't' in its name stands for 'threaded.' It was written by Wayne Davidson.

Unlike tin, trn has no provision for generating its threading database at runtime. Instead, it uses those prepared by a program called mthreads that has to be invoked regularly from cron to update the index files.

You can still access new articles if you're not running mthreads, but you will have all those 'A GENUINE INVESTMENT OPPORTUNITY' articles scattered across your article selection menu, instead of a single thread you may easily skip.

To turn on threading for particular newsgroups, invoke mthreads with the list of newsgroups on the command line. The format of the list is the same as the one in the C News sys file:

$ mthreads 'comp,rec,!rec.games.go'

This command enables threading for all of comp and rec, except for rec.games.go (people who play Go don't need fancy threads). After that, you simply invoke mthreads with no options at all to make it thread any newly arrived articles. Threading of all groups found in your active file can be turned on by invoking mthreads with a group list of all.

If you're receiving news during the night, you will customarily run mthreads once in the morning, but you can also to do so more frequently if necessary. Sites that have very heavy traffic may want to run mthreads in daemon mode. When it is started at boot time using the -d option, it puts itself in the background, wakes up every ten minutes to check if there are any newly arrived articles, and threads them. To run mthreads in daemon mode, put the following line in your rc.news script:

/usr/local/bin/rn/mthreads -deav

The -a option makes mthreads automatically turn on threading for new groups as they are created; -v enables verbose log messages to the mthreads log file mt.log in the directory where you have trn installed.

Old articles that are no longer available must be removed from the index files regularly. By default, only articles with a number below the low-water mark will be removed.[142] Articles above this number that have been expired (because the oldest article has been assigned a long expiration date by an Expires: header field) may nevertheless be removed by giving mthreads the -e option to force an 'enhanced' expiry run. When mthreads is running in daemon mode, the -e option makes mthreads put in such an enhanced expiry run once a day, shortly after midnight.

nn Configuration

nn, written by Kim F. Storm, claims to be a newsreader whose ultimate goal is not to read news. Its name stands for 'No News,' and its motto is 'No news is good news. nn is better.'

To achieve this ambitious goal, nn comes with a large assortment of maintenance tools that not only allow thread generation, but also extensive database consistency checks, accounting, gathering of usage statistics, and access restrictions. There is also an administration program called nnadmin, which allows you to perform these tasks interactively. It is very intuitive, so we will not dwell on these aspects, but deal only with the generation of the index files.

The nn threads database manager is called nnmaster. It is usually run as a daemon, started from an rc file at boot time. It is invoked as:

/usr/local/lib/nn/nnmaster -l -r -C

This enables threading for all newsgroups present in your active file.

Equivalently, you may invoke nnmaster periodically from cron, giving it a list of groups to act upon. This list is very similar to the subscription list in the sys file, except that it uses blanks instead of commas. Instead of the fake group name all, an empty argument of ' should be used to denote all groups. A sample invocation looks like this:

# /usr/local/lib/nn/nnmaster!rec.games.go rec comp

Note that the order is significant. The leftmost group specification that matches always wins. Thus, if we had put !rec.games.go after rec, all articles from this group would have been threaded nevertheless.

nn offers several methods to remove expired articles from its databases. The first is to update the database by scanning the newsgroup directories and discarding the entries whose corresponding article has exceeded its expiration date. This is the default operation obtained by invoking nnmaster with the -E option. It is reasonably quick, unless you're doing this via NNTP.

The second method behaves exactly like a default expiration run of mthreads; it removes only those entries that refer to articles with numbers below the low-water mark in the active file. It may be enabled using the -e option.

Finally, the third strategy discards the entire database and recollects all articles. It may be enabled using the -E3 option.

The list of groups to be expired is given by the -F option in the same fashion as

Добавить отзыв
ВСЕ ОТЗЫВЫ О КНИГЕ В ИЗБРАННОЕ

0

Вы можете отметить интересные вам фрагменты текста, которые будут доступны по уникальной ссылке в адресной строке браузера.

Отметить Добавить цитату