3 innduct \- quickly and reliably stream Usenet articles to remote site
11 implements NNTP peer-to-peer news transmission including the streaming
12 extensions, for sending news articles to a remote site.
14 You need to run one instance of innduct for each peer site. innduct
15 manages its interaction with innd, including flushing the feed as
16 appropriate, etc., so that articles are transmitted quickly, and
17 manages the retransmission of its own backlog. innduct includes the
18 locking necessary to avoid multiple simutaneous invocations.
20 By default, innduct reads the default feedfile corresponding to
24 .IR pathoutgoing / site )
25 and feeds it via NNTP, streaming if possible, to the host
30 is not specified, it defaults to
33 innduct daemonises after argument parsing, and all logging (including
34 error messages) are sent to syslog (facility
37 The best way to run innduct is probably to periodically invoke innduct
38 for each feed (e.g. from cron), passing innduct it the
40 option to arrange that it silently exits if an innduct is already
41 running for that site.
42 .SH INNDUCT VS INNFEED/NNTPSEND/INNXMIT
45 does roughly the same thing as innduct. However, the way it receives
46 information from innd can result in articles being lost (not offered
47 to peers) if innfeed crashes for any reason. This is an inherent
48 defect in the innd channel feed protocol. innduct uses a file feed,
49 constantly "tailing" the feed file, and where implemented uses
51 to reduce the latency which would come from having to constantly poll
52 the feed file. innfeed is capable of feeding multiple peers from a
53 single innfeed instance, whereas each innduct process handles exactly
54 one peer. innduct is much smaller and simpler, at 3kloc to innfeed's
55 25kloc. innfeed needs a separate wrapper script or similar
56 infrastructure (of which there is an example in its manpage), whereas
57 innduct can be run directly and doesn't need help from shell scripts.
60 processes feed files in batch mode. That is, you have to periodically
61 invoke nntpsend, and when you do, the feed is flushed and articles
62 which arrived before the flush are sent to the peer. This introduces
63 a batching delay, and also means that the NNTP connection to the peer
64 needs to be remade at each batch. nntpsend (which uses innxmit)
65 cannot make use of multiple connections to a single peer site.
66 However, nntpsend can be left to find automatically which sites need
71 is the actual NNTP feeder program used by nntpsend.
74 .BR \-f | \-\-feedfile= \fIfeedfile\fR
77 If the specified value ends in a
79 it is taken as a directory to use as if it were
81 and the actual feed file used is
82 .IR specified_feedfile / site .
84 .BR \-q | \-\-quiet-multiple
85 Makes innduct silently exit (with status 0) if another innduct holds
86 the lock for the site. Without \fB-q\fR, this causes a fatal error to
87 be logged and a nonzero exit.
90 Do not daemonise. innduct runs in the foreground and all messages
91 (including all debug messages) are written to stderr.
94 Do not try to use the streaming extensions to NNTP (for use eg if the
95 peer can't cope when we send MODE STREAM).
97 .BR \-C | \-\-inndconf= \fIFILE\fR
100 instead of the default
106 at the remote site rather than to the NNTP port (119).
109 Just print a brief usage message and list of the options to stdout.
111 You should not normally need to adjust these. Time intervals may
112 specified in seconds, or as a number followed by one of the following
115 .BR "sec min hour day" ,
118 .BI \-\-max-connections= max
119 Restricts the maximum number of simultaneous NNTP connections used by
124 There is no global limit on the number of connections.
126 .BI \-\-max-queue-per-conn= max
127 Restricts the maximum number of outstanding articles queued on any
128 particular connection
130 (Non-streaming connections can only handle one article at a time.)
134 .BI \-\-feedfile-flush-size= bytes
135 Specifies that innduct should flush the feed and start a new feedfile
136 when the existing feedfile size exceeds
138 the effect is that the innduct will try to avoid the various
139 batchfiles growing much beyond this size while the link to the peer is
140 working. The default is
143 .BI \-\-period-interval= PERIOD-INTERVAL
144 Specifies wakup interval and period granularity.
145 innduct wakes up every PERIOD-INTERVAL to do various housekeeping
146 checks. Also, many of the timeout and rescan intervals (those
147 specified in this manual as
149 .BI \-\-connection-timeout= TIME
150 How long to allow for a connection setup attempt before giving up.
154 .BI \-\-stuck-flush-timeout= TIME
155 How long to wait for innd to respond to a flush request before giving
159 .BI \-\-no-check-proportion= PERCENT
160 If the moving average of the proportion of articles being accepted
161 (rather than declined) by the peer exceeds this value, innduct uses
162 "no check mode" - ie it just sends the peer the articles with TAKETHIS
163 rather than checking first with CHECK whether the article is wanted.
164 This only affects streaming connections. The default is
168 .BI \-\-no-check-response-time= ARTICLES
169 The moving average mentioned above is an alpha-smoothed value with a
175 .BI \-\-reconnect-interval= PERIOD
176 Limits initiation of new connections to one each
178 This applies to reconnections if the peer has been down, and also to
179 ramping up the number of connections we are using after startup or in
180 response to an article flood. The default is
183 .BI \-\-flush-retry-interval= PERIOD
184 If our attempt to flush the feed failed (usually this will be because
185 innd is not running), try again after
190 .BI \-\-earliest-deferred-retry= PERIOD
191 When the peer responds to our offer of an article with a 431 or 436
192 NNTP response code, indicating that the article has already been
193 offered to it by another of its peers, and that we should try again,
196 before offering the article again. The default is
199 .BI \-\-backlog-rescan-interval= PERIOD
200 We scan the directory containing
202 for backlog files at least every
204 in case the administrator has manually dropped in a file there for
208 .BI \-\-max-flush-interval= PERIOD
209 We flush the feed at least every
211 even if the current instance of the feedfile has not reached the size
216 .BI \-\-max-flush-interval= PERIOD
217 We flush the feed and start a new feedfile at least every
219 even if the current instance of the feedfile has not reached the size
224 .BI \-\-idle-timeout= PERIOD
225 Connections which have had no activity for
227 will be closed. This includes connections where we have sent commands
228 or articles but have not yet had the responses, so this same value
229 doubles as the timeout after which we conclude that the peer is
230 unresponsive or the connection has become broken.
234 .BI \-\-max-bad-input-data-ratio= PERCENT
235 We tolerate up to this proportion of badly-formatted lines in the
236 feedfile and other input files. Every badly-formatted line is logged,
237 but if there are too many we conclude that the corruption to our
238 on-disk data is too severe, and crash; to successfully restart,
239 administrator intervention will be required. This avoids flooding the
240 logs with warnings and also arranges to abort earlyish if an attempt
241 is made to process a file in the wrong format.
246 .BI \-\-max-bad-input-data-init= LINES
247 Additionally, we tolerate this number of additional badly-formatted
248 lines, so that if the badly-formatted lines are a few but at the start
249 of the file, we don't crash immediately.
252 (which would suffice to ignore one whole corrupt 4096-byte disk block
253 filled with random data, or one corrupt 1024-byte disk block filled
254 with an inappropriate text file with a mean line length of at least
256 .SH INTERACTING WITH INNDUCT
257 innduct dances a somewhat complicated dance with innd to make sure
258 that everything goes smoothly and that there are no races. (See the
259 two ascii-art diagrams in innduct.c for details of the protocol.) Do
260 not mess with the feedfile and other associated files, other than as
261 explained below in the section
264 If you tell innd to drop the feed, innduct will (when it notices,
265 which will normally be the next time it decides flushes) finish up the
266 articles it has in hand now, and then exit. It is harmless to cause
267 innd to flush the feed (but innduct won't notice and flushing won't
268 start a new feedfile; you have to leave that to innduct).
270 There are no signals that can usefully be sent to innduct to give it
271 complicated instructions. If you need to kill innduct, feel free to
276 and nothing will be broken or corrupted.
280 An instance of innduct is already running for this
287 The feed has been dropped by innd, and we (or previous innducts) have
288 successfully offered all the old articles to the peer site. Our work
292 innduct was invoked with bad options or command line arguments. The
293 error message will be printed to stderr, and also (if any options or
294 arguments were passed at all) to syslog with severity
298 Things are going wrong, hopefully shortage of memory, system file
299 table entries; disk IO problems; disk full; etc. The specifics of the
300 error will be logged to syslog with severity
302 (if syslog is working!)
305 Things are going badly wrong in an unexpected way: system calls which
306 are not expected to fail are doing so, or the protocol for
307 communicating with innd is being violated, or some such. Details will
308 be logged with severity
310 (if syslog is working!)
313 These exit statuses are used by children forked by innduct to
314 communicate to the parent. You should not see them. If you do, it is
318 .IP \fIpathoutgoing\fR/\fIsite\fR
319 .IX Item "default feedfile"
324 Main feed file as specified in
326 This and other batchfiles used by innduct contains lines each of which
328 \& \fItoken\fR \fImessageid\fR
329 where \fItoken\fR is the inn storage API token. Such lines can be
330 written by \fBTf,Wnm\fR in a \fInewsfeeds\fR(5) entry. During
331 processing, innduct overwrites lines in the batch files which
332 correspond to articles it has processed: the line is replaced with
333 one containing only spaces. Only innd should create this file, and
334 only innduct should remove it.
335 .IP \fIfeedfile\fR_lock
337 Lockfile, preventing multiple innduct invocations for the same
338 feed. A process holds this lock after it has opened the lockfile,
339 made an fcntl F_SETLK call, and then checked with stat and fstat that
340 the file it now has open and has locked still has the name
341 \fIfeedfile\fR_lock. (Only) the lockholder may delete the lockfile.
342 For your convenience, after the lockfile is locked,
349 are all written to the lockfile. NB that stale lockfiles may contain
350 stale data so this information should not be relied on other than for
352 .IP \fIfeedfile\fR_flushing
353 .IX Item "flushing file"
354 Batch file: the main feedfile is renamed to this filename by innduct
355 before it asks inn to flush the feed. Only innduct should create or
357 .IP \fIfeedfile\fR_defer
358 .IX Item "flushing file"
359 Batch file containing details of articles whose transmission has
360 recently been deferred at the request of the recipient site. Created,
361 written, read and removed by innduct.
362 .IP \fIfeedfile\fR_backlog.\fItime_t\fR.\fIinum\fR
363 .IX Item "backlog file"
364 Batch file containing details of articles whose transmission has less
365 recently been deferred at the request of the recipient site. Created
366 by innduct, and will also be read and removed by innduct. However you
367 (the administrator) may also safely remove backlog files.
368 .IP \fIfeedfile\fR_backlog\fIsomething\fR
369 .IX Item "manual backlog file"
370 Batch file manually provided by the administrator. The file should be
371 complete and ready to process at the time it is renamed or hardlinked
372 to this name. innduct will then automatically find and read and
373 process it and eventually remove it. The administrator may also
374 safely remove backlog files. \fIsomething\fR may not contain \fB#\fR
375 \fB~\fR or \fB/\fR. Be sure to have finished writing the file before
376 you rename it to match the pattern \fIfeedfile\fR\fB_backlog\fR*, as
377 otherwise innduct may find and process the file and read it to EOF
378 before you have finished creating it.
379 .IP /etc/news/inn.conf
383 if none is specified, and also for
388 Written by Ian Jackson <ijackson@chiark.greenend.org.uk>