501 lines
9.4 KiB
HTML
501 lines
9.4 KiB
HTML
|
<HTML
|
||
|
><HEAD
|
||
|
><TITLE
|
||
|
>Control Messages</TITLE
|
||
|
><META
|
||
|
NAME="GENERATOR"
|
||
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.57"><LINK
|
||
|
REL="HOME"
|
||
|
TITLE="Linux Network Administrators Guide"
|
||
|
HREF="index.html"><LINK
|
||
|
REL="UP"
|
||
|
TITLE="C News"
|
||
|
HREF="x-087-2-cnews.html"><LINK
|
||
|
REL="PREVIOUS"
|
||
|
TITLE="Miscellaneous Files"
|
||
|
HREF="x-087-2-cnews.misc.html"><LINK
|
||
|
REL="NEXT"
|
||
|
TITLE="C News in an NFS Environment"
|
||
|
HREF="x-087-2-cnews.nfs.html"></HEAD
|
||
|
><BODY
|
||
|
CLASS="SECT1"
|
||
|
BGCOLOR="#FFFFFF"
|
||
|
TEXT="#000000"
|
||
|
LINK="#0000FF"
|
||
|
VLINK="#840084"
|
||
|
ALINK="#0000FF"
|
||
|
><DIV
|
||
|
CLASS="NAVHEADER"
|
||
|
><TABLE
|
||
|
WIDTH="100%"
|
||
|
BORDER="0"
|
||
|
CELLPADDING="0"
|
||
|
CELLSPACING="0"
|
||
|
><TR
|
||
|
><TH
|
||
|
COLSPAN="3"
|
||
|
ALIGN="center"
|
||
|
>Linux Network Administrators Guide</TH
|
||
|
></TR
|
||
|
><TR
|
||
|
><TD
|
||
|
WIDTH="10%"
|
||
|
ALIGN="left"
|
||
|
VALIGN="bottom"
|
||
|
><A
|
||
|
HREF="x-087-2-cnews.misc.html"
|
||
|
>Prev</A
|
||
|
></TD
|
||
|
><TD
|
||
|
WIDTH="80%"
|
||
|
ALIGN="center"
|
||
|
VALIGN="bottom"
|
||
|
>Chapter 21. C News</TD
|
||
|
><TD
|
||
|
WIDTH="10%"
|
||
|
ALIGN="right"
|
||
|
VALIGN="bottom"
|
||
|
><A
|
||
|
HREF="x-087-2-cnews.nfs.html"
|
||
|
>Next</A
|
||
|
></TD
|
||
|
></TR
|
||
|
></TABLE
|
||
|
><HR
|
||
|
ALIGN="LEFT"
|
||
|
WIDTH="100%"></DIV
|
||
|
><DIV
|
||
|
CLASS="SECT1"
|
||
|
><H1
|
||
|
CLASS="SECT1"
|
||
|
><A
|
||
|
NAME="X-087-2-CNEWS.CONTROL"
|
||
|
>21.8. Control Messages</A
|
||
|
></H1
|
||
|
><P
|
||
|
>
|
||
|
The Usenet news protocol knows a special category of articles that
|
||
|
evoke certain responses or actions by the news system. These are called
|
||
|
<I
|
||
|
CLASS="EMPHASIS"
|
||
|
>control</I
|
||
|
> messages. They are recognized by the presence of a
|
||
|
<TT
|
||
|
CLASS="REPLACEABLE"
|
||
|
><I
|
||
|
>Control:</I
|
||
|
></TT
|
||
|
> field in the article header, which contains the
|
||
|
name of the control operation to be performed. There are several types of them,
|
||
|
all of which are handled by shell scripts located in
|
||
|
<TT
|
||
|
CLASS="FILENAME"
|
||
|
>/usr/lib/news/ctl</TT
|
||
|
>.</P
|
||
|
><P
|
||
|
>Most of these messages perform their action automatically at the time the article
|
||
|
is processed by C News without notifying the newsmaster. By default, only
|
||
|
<SPAN
|
||
|
CLASS="SYSTEMITEM"
|
||
|
>checkgroups</SPAN
|
||
|
> messages will be handed
|
||
|
to the newsmaster, but you may change this by editing the scripts.</P
|
||
|
><DIV
|
||
|
CLASS="SECT2"
|
||
|
><H2
|
||
|
CLASS="SECT2"
|
||
|
><A
|
||
|
NAME="X-087-2-CNEWS.CONTROL.CANCEL"
|
||
|
>21.8.1. The cancel Message</A
|
||
|
></H2
|
||
|
><P
|
||
|
>
|
||
|
The most widely known message is <SPAN
|
||
|
CLASS="SYSTEMITEM"
|
||
|
>cancel</SPAN
|
||
|
>, with which a user can cancel an
|
||
|
article sent earlier. This effectively removes the article from the
|
||
|
spool directories, if it exists. The <SPAN
|
||
|
CLASS="SYSTEMITEM"
|
||
|
>cancel</SPAN
|
||
|
> message is forwarded to all sites
|
||
|
that receive news from the groups affected, regardless of whether the
|
||
|
article has been seen already. This takes into account the possibility
|
||
|
that the original article has been delayed over the cancellation
|
||
|
message. Some news systems allow users to cancel other people's
|
||
|
messages; this is, of course, a definite no-no.</P
|
||
|
></DIV
|
||
|
><DIV
|
||
|
CLASS="SECT2"
|
||
|
><H2
|
||
|
CLASS="SECT2"
|
||
|
><A
|
||
|
NAME="X-087-2-CNEWS.CONTROL.ADDGROUP"
|
||
|
>21.8.2. newgroup and rmgroup</A
|
||
|
></H2
|
||
|
><P
|
||
|
>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
Two messages dealing with creation or removal of newsgroups are the
|
||
|
<SPAN
|
||
|
CLASS="SYSTEMITEM"
|
||
|
>newgroup</SPAN
|
||
|
> and
|
||
|
<SPAN
|
||
|
CLASS="SYSTEMITEM"
|
||
|
>rmgroup</SPAN
|
||
|
> messages. Newsgroups below the
|
||
|
“usual” hierarchies may be created only after a discussion and
|
||
|
voting has been held among Usenet readers. The rules applying to the
|
||
|
<SPAN
|
||
|
CLASS="SYSTEMITEM"
|
||
|
>alt</SPAN
|
||
|
> hierarchy allow for something
|
||
|
close to anarchy. For more information, see the regular postings in
|
||
|
<SPAN
|
||
|
CLASS="SYSTEMITEM"
|
||
|
>news.announce.newusers</SPAN
|
||
|
> and
|
||
|
<SPAN
|
||
|
CLASS="SYSTEMITEM"
|
||
|
>news.announce.newgroups</SPAN
|
||
|
>. Never send
|
||
|
a <SPAN
|
||
|
CLASS="SYSTEMITEM"
|
||
|
>newgroup</SPAN
|
||
|
> or
|
||
|
<SPAN
|
||
|
CLASS="SYSTEMITEM"
|
||
|
>rmgroup</SPAN
|
||
|
> message yourself unless you
|
||
|
definitely know that you are allowed to.</P
|
||
|
></DIV
|
||
|
><DIV
|
||
|
CLASS="SECT2"
|
||
|
><H2
|
||
|
CLASS="SECT2"
|
||
|
><A
|
||
|
NAME="X-087-2-CNEWS.CONTROL.CHECKGROUPS"
|
||
|
>21.8.3. The checkgroups Message</A
|
||
|
></H2
|
||
|
><P
|
||
|
>
|
||
|
|
||
|
<SPAN
|
||
|
CLASS="SYSTEMITEM"
|
||
|
>checkgroups</SPAN
|
||
|
> messages are sent by news
|
||
|
administrators to make all sites within a network synchronize their
|
||
|
<TT
|
||
|
CLASS="FILENAME"
|
||
|
>active</TT
|
||
|
> files with the realities of Usenet. For example,
|
||
|
commercial Internet Service Providers might send out such a message to their
|
||
|
customers' sites. Once a month, the “official”
|
||
|
<SPAN
|
||
|
CLASS="SYSTEMITEM"
|
||
|
>checkgroups</SPAN
|
||
|
> message for the major
|
||
|
hierarchies is posted to
|
||
|
<SPAN
|
||
|
CLASS="SYSTEMITEM"
|
||
|
>comp.announce.newgroups</SPAN
|
||
|
> by its
|
||
|
moderator. However, it is posted as an ordinary article, not as a control
|
||
|
message. To perform the <SPAN
|
||
|
CLASS="SYSTEMITEM"
|
||
|
>checkgroups</SPAN
|
||
|
>
|
||
|
operation, save this article to a file, say <TT
|
||
|
CLASS="FILENAME"
|
||
|
>/tmp/check</TT
|
||
|
>,
|
||
|
remove everything up to the beginning of the control message itself, and feed
|
||
|
it to the <SPAN
|
||
|
CLASS="SYSTEMITEM"
|
||
|
>checkgroups</SPAN
|
||
|
> script using the
|
||
|
following command:
|
||
|
|
||
|
<TABLE
|
||
|
BORDER="0"
|
||
|
BGCOLOR="#E0E0E0"
|
||
|
WIDTH="100%"
|
||
|
><TR
|
||
|
><TD
|
||
|
><PRE
|
||
|
CLASS="SCREEN"
|
||
|
># <TT
|
||
|
CLASS="USERINPUT"
|
||
|
><B
|
||
|
>su news -c "/usr/lib/news/ctl/checkgroups" < /tmp/check</B
|
||
|
></TT
|
||
|
></PRE
|
||
|
></TD
|
||
|
></TR
|
||
|
></TABLE
|
||
|
></P
|
||
|
><P
|
||
|
>This will update your <TT
|
||
|
CLASS="FILENAME"
|
||
|
>newsgroups</TT
|
||
|
> file from the new list
|
||
|
of groups, adding the groups
|
||
|
listed in <TT
|
||
|
CLASS="FILENAME"
|
||
|
>localgroups</TT
|
||
|
>. The old
|
||
|
<TT
|
||
|
CLASS="FILENAME"
|
||
|
>newsgroups</TT
|
||
|
> file will be moved to
|
||
|
<TT
|
||
|
CLASS="FILENAME"
|
||
|
>newsgroups.bac</TT
|
||
|
>. Note that posting the message locally
|
||
|
rarely works, because <B
|
||
|
CLASS="COMMAND"
|
||
|
>inews</B
|
||
|
>, the command that accepts
|
||
|
and posts articles from users, refuses to accept that large an article.</P
|
||
|
><P
|
||
|
>If C News finds mismatches between the
|
||
|
<SPAN
|
||
|
CLASS="SYSTEMITEM"
|
||
|
>checkgroups</SPAN
|
||
|
> list and the
|
||
|
<TT
|
||
|
CLASS="FILENAME"
|
||
|
>active</TT
|
||
|
> file, it produces a list of commands that
|
||
|
would bring your site up to date and mails it to the news administrator. </P
|
||
|
><P
|
||
|
>The output typically looks like this:
|
||
|
|
||
|
<TABLE
|
||
|
BORDER="0"
|
||
|
BGCOLOR="#E0E0E0"
|
||
|
WIDTH="100%"
|
||
|
><TR
|
||
|
><TD
|
||
|
><PRE
|
||
|
CLASS="SCREEN"
|
||
|
>From news Sun Jan 30 16:18:11 1994
|
||
|
Date: Sun, 30 Jan 94 16:18 MET
|
||
|
From: news (News Subsystem)
|
||
|
To: usenet
|
||
|
Subject: Problems with your active file
|
||
|
The following newsgroups are not valid and should be removed.
|
||
|
alt.ascii-art
|
||
|
bionet.molbio.gene-org
|
||
|
comp.windows.x.intrisics
|
||
|
de.answers
|
||
|
You can do this by executing the commands:
|
||
|
/usr/lib/news/maint/delgroup alt.ascii-art
|
||
|
/usr/lib/news/maint/delgroup bionet.molbio.gene-org
|
||
|
/usr/lib/news/maint/delgroup comp.windows.x.intrisics
|
||
|
/usr/lib/news/maint/delgroup de.answers
|
||
|
The following newsgroups were missing.
|
||
|
comp.binaries.cbm
|
||
|
comp.databases.rdb
|
||
|
comp.os.geos
|
||
|
comp.os.qnx
|
||
|
comp.unix.user-friendly
|
||
|
misc.legal.moderated
|
||
|
news.newsites
|
||
|
soc.culture.scientists
|
||
|
talk.politics.crypto
|
||
|
talk.politics.tibet</PRE
|
||
|
></TD
|
||
|
></TR
|
||
|
></TABLE
|
||
|
></P
|
||
|
><P
|
||
|
>When you receive a message like this from your news system, don't
|
||
|
believe it automatically. Depending on who sent the
|
||
|
<SPAN
|
||
|
CLASS="SYSTEMITEM"
|
||
|
>checkgroups</SPAN
|
||
|
> message, it may lack a few
|
||
|
groups or even entire hierarchies; you should be careful about removing
|
||
|
any groups. If you find groups are listed as missing that you want to carry
|
||
|
at your site, you have to add them using the <B
|
||
|
CLASS="COMMAND"
|
||
|
>addgroup</B
|
||
|
>
|
||
|
script. Save the list of missing groups to a file and feed it to the
|
||
|
following little script:
|
||
|
|
||
|
<TABLE
|
||
|
BORDER="0"
|
||
|
BGCOLOR="#E0E0E0"
|
||
|
WIDTH="100%"
|
||
|
><TR
|
||
|
><TD
|
||
|
><PRE
|
||
|
CLASS="PROGRAMLISTING"
|
||
|
>#!/bin/sh
|
||
|
#
|
||
|
WHOIAM=`whoami`
|
||
|
if [ "$WHOIAM" != "news" ]
|
||
|
then
|
||
|
echo "You must run $0 as user 'news'" >&2
|
||
|
exit 1
|
||
|
fi
|
||
|
#
|
||
|
cd /usr/lib/news
|
||
|
while read group; do
|
||
|
if grep -si "^$group[[:space:]].*moderated" newsgroup; then
|
||
|
mod=m
|
||
|
else
|
||
|
mod=y
|
||
|
fi
|
||
|
/usr/lib/news/maint/addgroup $group $mod
|
||
|
done</PRE
|
||
|
></TD
|
||
|
></TR
|
||
|
></TABLE
|
||
|
> </P
|
||
|
></DIV
|
||
|
><DIV
|
||
|
CLASS="SECT2"
|
||
|
><H2
|
||
|
CLASS="SECT2"
|
||
|
><A
|
||
|
NAME="X-087-2-CNEWS.CONTROL.SENDSYS"
|
||
|
>21.8.4. sendsys, version, and senduuname</A
|
||
|
></H2
|
||
|
><P
|
||
|
> Finally, there are three messages that can be used to find out about
|
||
|
the network's topology. These are <SPAN
|
||
|
CLASS="SYSTEMITEM"
|
||
|
>sendsys</SPAN
|
||
|
>, <SPAN
|
||
|
CLASS="SYSTEMITEM"
|
||
|
>version</SPAN
|
||
|
>, and <SPAN
|
||
|
CLASS="SYSTEMITEM"
|
||
|
>senduuname</SPAN
|
||
|
>. They cause C News to return
|
||
|
the <TT
|
||
|
CLASS="FILENAME"
|
||
|
>sys</TT
|
||
|
> file to the sender, as well as a software
|
||
|
version string and the output of <B
|
||
|
CLASS="COMMAND"
|
||
|
>uuname</B
|
||
|
>,
|
||
|
respectively. C News is very laconic about <SPAN
|
||
|
CLASS="SYSTEMITEM"
|
||
|
>version</SPAN
|
||
|
> messages; it returns a simple,
|
||
|
unadorned <TT
|
||
|
CLASS="LITERAL"
|
||
|
>C</TT
|
||
|
>.</P
|
||
|
><P
|
||
|
>Again, you should <I
|
||
|
CLASS="EMPHASIS"
|
||
|
>never</I
|
||
|
> issue such a message unless you
|
||
|
have made sure that it cannot leave your (regional) network. Replies to
|
||
|
<SPAN
|
||
|
CLASS="SYSTEMITEM"
|
||
|
>sendsys</SPAN
|
||
|
> messages can quickly bring down
|
||
|
a UUCP network.<A
|
||
|
NAME="X-087-2-FNCN09"
|
||
|
HREF="#FTN.X-087-2-FNCN09"
|
||
|
>[1]</A
|
||
|
></P
|
||
|
></DIV
|
||
|
></DIV
|
||
|
><H3
|
||
|
CLASS="FOOTNOTES"
|
||
|
>Notes</H3
|
||
|
><TABLE
|
||
|
BORDER="0"
|
||
|
CLASS="FOOTNOTES"
|
||
|
WIDTH="100%"
|
||
|
><TR
|
||
|
><TD
|
||
|
ALIGN="LEFT"
|
||
|
VALIGN="TOP"
|
||
|
WIDTH="5%"
|
||
|
><A
|
||
|
NAME="FTN.X-087-2-FNCN09"
|
||
|
HREF="x-087-2-cnews.control.html#X-087-2-FNCN09"
|
||
|
>[1]</A
|
||
|
></TD
|
||
|
><TD
|
||
|
ALIGN="LEFT"
|
||
|
VALIGN="TOP"
|
||
|
WIDTH="95%"
|
||
|
><P
|
||
|
>I wouldn't try this on the Internet, either.</P
|
||
|
></TD
|
||
|
></TR
|
||
|
></TABLE
|
||
|
><DIV
|
||
|
CLASS="NAVFOOTER"
|
||
|
><HR
|
||
|
ALIGN="LEFT"
|
||
|
WIDTH="100%"><TABLE
|
||
|
WIDTH="100%"
|
||
|
BORDER="0"
|
||
|
CELLPADDING="0"
|
||
|
CELLSPACING="0"
|
||
|
><TR
|
||
|
><TD
|
||
|
WIDTH="33%"
|
||
|
ALIGN="left"
|
||
|
VALIGN="top"
|
||
|
><A
|
||
|
HREF="x-087-2-cnews.misc.html"
|
||
|
>Prev</A
|
||
|
></TD
|
||
|
><TD
|
||
|
WIDTH="34%"
|
||
|
ALIGN="center"
|
||
|
VALIGN="top"
|
||
|
><A
|
||
|
HREF="index.html"
|
||
|
>Home</A
|
||
|
></TD
|
||
|
><TD
|
||
|
WIDTH="33%"
|
||
|
ALIGN="right"
|
||
|
VALIGN="top"
|
||
|
><A
|
||
|
HREF="x-087-2-cnews.nfs.html"
|
||
|
>Next</A
|
||
|
></TD
|
||
|
></TR
|
||
|
><TR
|
||
|
><TD
|
||
|
WIDTH="33%"
|
||
|
ALIGN="left"
|
||
|
VALIGN="top"
|
||
|
>Miscellaneous Files</TD
|
||
|
><TD
|
||
|
WIDTH="34%"
|
||
|
ALIGN="center"
|
||
|
VALIGN="top"
|
||
|
><A
|
||
|
HREF="x-087-2-cnews.html"
|
||
|
>Up</A
|
||
|
></TD
|
||
|
><TD
|
||
|
WIDTH="33%"
|
||
|
ALIGN="right"
|
||
|
VALIGN="top"
|
||
|
>C News in an NFS Environment</TD
|
||
|
></TR
|
||
|
></TABLE
|
||
|
></DIV
|
||
|
></BODY
|
||
|
></HTML
|
||
|
>
|