From tal@Warren.MENTORG.COM Wed Jul 20 14:00:19 EDT 1994
Article: 10167 of news.software.nntp
Path: uunet!newsgw.mentorg.com!sdl!not-for-mail
From: tal@Warren.MENTORG.COM (Tom Limoncelli)
Newsgroups: news.software.nntp
Subject: Re: INN ctlrun question
Date: 14 Jul 1994 15:29:27 -0400
Organization: Mentor Graphics -- IC Group, Warren, NJ, USA
Lines: 85
Sender: tal@Warren.MENTORG.COM
Distribution: inet
Message-ID: <3043mn$i6v$1@sdl.Warren.MENTORG.COM>
References: <2vutaa$1qk@asphodel.bogs.org> <3026i4$91l@falcon.varian.com>
NNTP-Posting-Host: sdl.warren.mentorg.com
Xref: uunet news.software.nntp:10167

In <3026i4$91l@falcon.varian.com> Andrew.Castillo@CIS.Varian.COM (Andrew CAstillo) writes:

>On this same subject - could someone explain the process used to manage
>control messages (i.e. control.ctl, ctlrun)

control.ctl: It would be easier if you said what in control.ctl's man page you
didn't understand.

ctlrun: I never even knew the file existed.  It seems to be a useless
script for re-executing control messages.  However, innd executes the
control messages when they arrive, so there is no need for that
script.  IMHO, Rich should rm it from the distribution.

(Rich, if you want to add this to the INN man pages or something, that's
fine by me)

Control mesages:
Overview
	There is no special "control message".  The phrase "control
message" means a regular article posted to a normal newsgroup BUT it
has a "Control:" header.  When innd sees such a message, it processes
the command and stores the message.

	A.  Processing

		1.  Since "cancel" messages arrive by the bucketfull, innd
			processes "Control: cancel <message-id@site>" by itself.

		2.  All other commands are received so rarely that they are
			written as shell scripts.  This permits lets the
			newsadmin modify their behaviour much easier than if
			they were written in C.  The shell script is usually a
			couple lines of set-up followed by a call to "ctlinnd",
			so speed is still dependent on C code (innd and
			ctlinnd) than shell speed.

		3.  The actual processing happens as follows:  When a control
			message arrives, the first word of the text is
			converted  to lowercase and used as the name of the
			pro- gram to execute; if the named program does not
			exist, then a program named "default" is executed.

			All control programs are invoked with four
			parameters.   These are described in innd(8).  Scripts
			usually call the "parsecontrol" which advises them
			(based on control.ctl) if they should execute the
			command, mail it to "newsmaster", etc, etc.  See the
			control.ctl man page.

			You can create a new control message whenever you
			want.  Just write the shell script!

	B.  Storage

		1.  So-as not to clutter the newsgroups, the control messages
			are stored in a directory called "control".  "control"
			is not a real newsgroup, but it is listed in "active"
			so that the files in it can be expired with the same
			expire program used for deleting old articles.  The
			file names are numbers (1001, 1002, 1003, etc.) just
			like regular articles so that, again, very little new
			code has to be written to handle control messages.

		2.  INN has a feature to help newsadmins take better care of
			their control messages.  If you create a newsgroup
			called "control.newgroup", then "Control: newgroup"
			messages will be stored there.  This works for all
			control messages.  If a newsgroup doesn't exist for a
			control message, the article is stored in "control" as
			normal.  Many sites have a "control" and
			"control.cancel" so-as to split off the bucketfulls of
			"cancel" messages (which can be ignored) and just the
			rare commands can be watched.

	C.  Passing control messages to other sites.

		The rules for distributing messages with Control: headers is a little
		different than for usual articles.  See innd(8) for a complete description;
		as well as a description of the .ctl pseudo-newsgroup.

-- 
    Tom Limoncelli -- tal@warren.mentorg.com (work) -- tal@plts.uucp (play)

                   The internet is like a box of chocolates.



