📄 1161-1162.html
字号:
<HTML>
<HEAD>
<TITLE>Linux Complete Command Reference:File Formats:EarthWeb Inc.-</TITLE>
</HEAD>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>
-->
<!-- ISBN=0672311046 //-->
<!-- TITLE=Linux Complete Command Reference//-->
<!-- AUTHOR=Red Hat//-->
<!-- PUBLISHER=Macmillan Computer Publishing//-->
<!-- IMPRINT=Sams//-->
<!-- CHAPTER=05 //-->
<!-- PAGES=1103-1208 //-->
<!-- UNASSIGNED1 //-->
<!-- UNASSIGNED2 //-->
<P><CENTER>
<a href="1160-1160.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="1163-1164.html">Next</A></CENTER></P>
<A NAME="PAGENUM-1161"><P>Page 1161</P></A>
<BLOCKQUOTE>
The H and O items are intended for use by programs that create news overview databases. If
H is present, then the all the article's headers are written followed by a blank line. An
Xref header (even if one does not appear in the filed article) and a Bytes header, specifying
the article's size, will also be part of the headers. If used, this should be the only item in the
list; if preceded by other items, however, a newline will be written before the headers. The
O generates input to the overchan(8) program. It, too, should be the only item in the list.
</P>
The asterisk has special meaning. It expands to a space-separated list of all sites that
received the current article. If the site is the target of a funnel, however (that is, it is named by
other sites that have a Tm flag), then the asterisk expands to the names of the funnel feeds
that received the article. If the site is fed by a program, then an asterisk in the param field will
be expanded into the list of funnel feeds that received the article. A site fed by a
program cannot get the site list unless it is the target of other
Tm feeds.
</BLOCKQUOTE>
<P>The interpretation of the param field depends on the type of feed, and is explained in more detail in the section on feed
types. It can be omitted.
</P>
<P>The site named ME is special. There should only be one such entry, and it should be the first entry in the file. If the
ME entry has a subscription list, then that list is automatically prepended to the subscription list of all other entries. For
example, *,!control,!junk,!foo.* can be used to set up the initial subscription list for all feeds so that local postings are not
propagated unless foo.* explicitly appears in the site's subscription list. Note that most subscriptions should have
!junk,!control in their pattern list; see the discussion of control messages in
innd(8). (Unlike other news software, it does not affect
what groups are received; that is done by the
active(5) file.)
</P>
<P>If the ME entry has a distribution subfield, then only articles that match the distribution list are accepted; all other articles
are rejected. A commercial news server, for example, might have
/!local to reject local postings from other, misconfigured, sites.
</P>
<P><B>
FEED TYPES
</B></P>
<P>innd provides four basic types of feeds: log, file, program, and channel. An exploder is a special type of channel. In
addition, several entries can feed into the same feed; these are funnel feeds, which refer to an entry that is one of the other types.
Note that the term "feed" is technically a misnomer because the server does not transfer articles but reports that an article
should be sent to the site.
</P>
<P>The simplest feed is one that is fed by a log entry. Other than a mention in the news logfile, no data is ever written out.
This is equivalent to a Tf entry writing to
/dev/null except that no file is opened.
</P>
<P>A site fed by a file is simplest type of feed. When the site should receive an article, one line is written to the file named by
the param field. If param is not an absolute pathname, it is taken to be relative to
/news/spool/out.going. If empty, the filename defaults to
/news/spool/out.going/sitename. This name should be unique.
</P>
<P>When a site fed by a file is flushed (see
ctlinnd), the following steps are performed. The script doing the flush should
have first renamed the file. The server tries to write out any buffered data and then closes the file. The renamed file is
now available for use. The server will then reopen the original file, which will now get created.
</P>
<P>A site fed by a program has a process spawned for every article that the site receives. The
param field must be a sprintf(3) format string that may have a single
%s parameter, which will be given a pathname for the article, relative to the news
spool directory. The full pathname may be obtained by prefixing the
%s in the param field by the news spool directory
prefix. Standard input will be set to the article or
/dev/null if the article cannot be opened for some reason. Standard output
and error will be set to the error log. The process will run with the user and group ID of the
/news/lib/innd directory. innd will try to avoid spawning a shell if the command has no shell meta-characters; this feature can be defeated by appending
a semicolon to the end of the command. The full pathname of the program to be run must be specified; for security,
PATH is not searched.
</P>
<P>If the entry is the target of a funnel, and if the
W* flag is used, then a single asterisk may be used in the
param field where it will be replaced by the names of the sites that fed into the funnel. If the entry is not a funnel, or if the
W* flag is not used, then the asterisk has no special meaning.
</P>
<A NAME="PAGENUM-1162"><P>Page 1162</P></A>
<P>Flushing a site fed by a program does no action.
</P>
<P>When a site is fed by a channel or exploder, the
param field names the process to start. Again, the full pathname of the
process must be given. When the site is to receive an article, the process receives a line on its standard input telling it about
the article. Standard output and error and the user and group ID of the all subprocess are set as for a program feed. If the
process exits, it will be restarted. If the process cannot be started, the server will spool input to a file named
/news/spool/out.going/sitename. It will then try to start the process some time later.
</P>
<P>When a site fed by a channel or exploder is flushed, the server closes down its end of the pipe. Any pending data that has
not been written will be spooled; see the description of the
S flag. No signal is sent; it is up to the program to notice EOF on
its standard input and exit. The server then starts a new process.
</P>
<P>Exploders are a superset of channel feeds. In addition to channel behavior, exploders can be sent command lines. These
lines start with an exclamation point, and their interpretation is up to the exploder. The following messages are
generated automatically by the server:
</P>
<!-- CODE SNIP //-->
<PRE>
newgroup group
rmgroup group
flush
flush site
</PRE>
<!-- END CODE SNIP //-->
<P>These messages are sent when the ctlinnd command of the same name is received by the server. In addition, the
send command can be used to send an arbitrary command line to the exploder child-process. The primary exploder is
buffchan(8).
</P>
<P>Funnel feeds provide a way of merging several site entries into a single output stream. For a site feeding into a funnel,
the param field names the actual entry that does the feeding.
</P>
<P>For more details on setting up different types of news feeds, see the INN installation manual.
</P>
<P><B>
EXAMPLES
</B></P>
<!-- CODE //-->
<PRE>
## Initial subscription list and our distributions.
ME:*,!junk,!foo.*/world,usa,na,ne,foo,ddn,gnu,inet\
::
## Feed all moderated source postings to an archiver
source-archive!:!*,comp.sources.*\
:Tp,Nm:/usr/local/bin/archive %s
## Watch for big postings
watcher!:*\
:Tc,Wbnm\
:exec awk `$1 > 1000000 { print "BIG", $2, $3 }' >/dev/console
## A UUCP feed, where we try to keep the "batching" between 4 and 1K.
ihnp4:/world,usa,na,ddn,gnu\
:Tf,Wfb,B4096/1024:
## Usenet as mail; note ! in funnel name to avoid Path conflicts.
## Can't use ! in "fred" since it would like look a UUCP address.
fred:!*,comp.sources.unix,comp.sources.bugs\
:Tm:mailer!
barney@bar.com:!*,news.software.nntp,comp.sources.bugs\
:Tm:mailer!
mailer!:!*\
:W*,Tp:/usr/ucb/Mail -s "News article" *
## NNTP feeds fed off-line via nntpsend or equivalent.
feed1::Tf,Wnm:feed1.domain.name
peer.foo.com:foo.*:Tf,Wnm:peer.foo.com
## Real-time transmission.
mit.edu:/world,usa,na,ne,ddn,gnu,inet\
:Tc,Wnm:/nntplink -i stdin mit.edu
## Two sites feeding into a hypothetical NNTP fan-out program:
nic.near.net:\
:Tm:nntpfunnel1
</PRE>
<!-- END CODE //-->
<P><CENTER>
<a href="1160-1160.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="1163-1164.html">Next</A></CENTER></P>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -