instead of the default
.BR inn.conf .
.TP
+.BI \-\-ctrl-sock-dir= DIR
+Use
+.I DIR
+as the directory to contain the actual control socket. See
+CONTROLLING INNDUCT, below.
+If
+.I DIR
+does not exist it will be created with mode 0700; if it does
+exist it must not be a symlink and must be owned by the user running
+innduct and have no access for "other". If the control socket cannot
+be set up (for this or any other reason), a warning is logged, but
+such situations are not fatal for innduct's startup. The default is
+.BR /tmp/innduct.control .
+.TP
.BI \-\-port= PORT
Connect to port
.I PORT
The default is
.BR 100 .
.TP
-.BI \-\-reconnect-interval= PERIOD
+.BI \-\-reconnect-interval= RECONNECT-PERIOD
Limits initiation of new connections to one each
-.IR PERIOD .
+.IR RECONNECT-PERIOD .
This applies to reconnections if the peer has been down, and also to
ramping up the number of connections we are using after startup or in
response to an article flood. The default is
before offering the article again. The default is
.BR 50s .
.TP
-.BI \-\-backlog-rescan-interval= PERIOD
+.BI \-\-backlog-rescan-interval= BACKLOG-SCAN-PERIOD
We scan the directory containing
.I feedfile
for backlog files at least every
-.IR PERIOD ,
+.IR BACKLOG-SCAN-PERIOD ,
in case the administrator has manually dropped in a file there for
processing.
The default is
The default is
.BR 100000s .
.TP
+.BI \-\-flush-finish-timeout= FLUSH-FINISH-PERIOD
+If we flushed
+.IR FLUSH-FINISH-PERIOD
+ago, and are still trying to finish processing articles that were
+written to the old feed file, we forcibly and violently make sure that
+we do by abandoning and deferring all the work (which includes
+unceremoniously dropping any connections on which we've sent some of
+those articles but not yet had replies, as they're probably stuck
+somehow).
+The default is
+.BR 2000s .
+.TP
.BI \-\-idle-timeout= PERIOD
Connections which have had no activity for
.IR PERIOD
filled with random data, or one corrupt 1024-byte disk block filled
with an inappropriate text file with a mean line length of at least
35).
-.SH INTERACTING WITH INNDUCT
-innduct dances a somewhat complicated dance with innd to make sure
-that everything goes smoothly and that there are no races. (See the
-two ascii-art diagrams in innduct.c for details of the protocol.) Do
-not mess with the feedfile and other associated files, other than as
-explained below in the section
-.BR FILES .
-.LP
+.SH CONTROLLING INNDUCT
If you tell innd to drop the feed, innduct will (when it notices,
which will normally be the next time it decides flushes) finish up the
articles it has in hand now, and then exit. It is harmless to cause
innd to flush the feed (but innduct won't notice and flushing won't
start a new feedfile; you have to leave that to innduct).
.LP
-There are no signals that can usefully be sent to innduct to give it
-complicated instructions. If you need to kill innduct, feel free to
-send it a
-.B SIGTERM
+If you want to stop innduct you can send it SIGTERM or SIGINT, or the
+.B stop
+control command, in which case it will report statistics so far and
+quickly exit. If innduct receives SIGKILL nothing will be broken or
+corrupted; you just won't see some of the article stats.
+innduct listens on an AF_UNIX socket, and provides a command-line
+interface which can be used to trigger various events and for
+debugging.
+.LP
+The socket is called
+.IB feedfile _control
+and when connected reads and writes lines (with unix line endings).
+It can most easily be accessed with a program like
+.I netcat-openbsd
+(eg
+.B nc.openbsd -U
+.IR feedfile \fB_control\fR)
or
-.B SIGKILL
-and nothing will be broken or corrupted.
+.IR socat .
+The CLI has as a prompt
+.IR site \fB|\fR.
+.LP
+Because there is a fairly short limit on the length of pathnames used
+for AF_UNIX sockets, innduct actually creates the socket with a unique
+name in a different dedicated subdirectory of /tmp, and makes
+.IB feedfile _control
+a symlink to the real socket.
+.LP
+The following control commands are supported:
+.TP
+.B h
+Print a list of all the commands understood. This list includes
+undocumented commands which mess with innduct's internal state and
+should only be used by a developer in conjuction with the innduct
+source code.
+.TP
+.B flush
+Start a new feed file and trigger a flush of the feed. (Or, cause
+the
+.I FLUSH-FINISH-PERIOD
+to expire early, forcibly completing a previously started flush.)
+.TP
+.B stop
+Log statistics and exit. (Same effect as SIGTERM or SIGINT.)
+.TP
+.BR "dump q" | a
+Writes information about innduct's state to a plain text file
+.IR feedfile \fB_dump\fR.
+This overwrites any previous dump.
+.B "dump q"
+is a summary including general state and a list of connections;
+.B "dump a"
+also includes information about each article innduct is dealing with.
+.TP
+.B next blscan
+Requests that innduct rescan for new backlog files at the next
+.I PERIOD
+poll. Normally innduct assumes that any backlog files dropped in by
+the administrator are not urgent and may not get around to noticing
+them for
+.IR BACKLOG-SCAN-PERIOD .
+.TP
+.B next conn
+Resets the connection startup delay counter so that innduct may
+consider making a new connection to the peer right away, regardless
+of the setting of
+.IR RECONNECT-PERIOD .
+A connection attempt will still only be made if innduct feels that it
+needs one, and innduct may wait up to
+.I PERIOD
+before actually starting the attempt.
+.IR BACKLOG-SCAN-PERIOD .
.SH EXIT STATUS
.TP
.B 0
communicate to the parent. You should not see them. If you do, it is
a bug.
.SH FILES
+innduct dances a somewhat complicated dance with innd to make sure
+that everything goes smoothly and that there are no races. (See the
+two ascii-art diagrams in innduct.c for details of the protocol.) Do
+not mess with the feedfile and other associated files, other than as
+explained here:
.IX Header "FILES"
.IP \fIpathoutgoing\fR/\fIsite\fR
.IX Item "default feedfile"
you rename it to match the pattern \fIfeedfile\fR\fB_backlog\fR*, as
otherwise innduct may find and process the file and read it to EOF
before you have finished creating it.
+.IP \fIfeedfile\fR_dump
+.IX Item "debug dump file"
+On request via a control connection innduct dumps a summary of its
+state to this text file. This is mostly useful for debugging.
.IP /etc/news/inn.conf
.IX Item inn.conf
Used to find