From 55cb8dcfa035728631492596baa74844d98c20d0 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 21 Apr 2010 21:46:16 +0100 Subject: [PATCH] more manpage, remove -h option --- backends/innduct.c | 24 +++++++++++--------- doc/man/innduct.8 | 56 +++++++++++++++++++++++++++++++++++----------- 2 files changed, 56 insertions(+), 24 deletions(-) diff --git a/backends/innduct.c b/backends/innduct.c index f7300a3..7fa943d 100644 --- a/backends/innduct.c +++ b/backends/innduct.c @@ -160,10 +160,13 @@ perl -ne 'print if m/-8\<-/..m/-\>8-/; print "\f" if m/-\^L-/' backends/innduct. /*----- configuration options -----*/ static char *sitename, *feedfile; +static const char *remote_host; +static int quiet_multiple=0; + static int max_connections=10, max_queue_per_conn=200; + static int connection_setup_timeout=200, port=119, try_stream=1; -static int inndcomm_flush_timeout=100, quiet_if_locked=0; -static const char *remote_host; +static int inndcomm_flush_timeout=100; static int reconnect_delay_periods, flushfail_retry_periods, open_wait_periods; static int backlog_retry_minperiods, backlog_spontaneous_rescan_periods; static const char *inndconffile; @@ -1604,7 +1607,7 @@ static void statemc_init(void) { r= fcntl(lockfd, F_SETLK, &fl); if (r==-1) { if (errno==EACCES || errno==EAGAIN) { - if (quiet_if_locked) exit(0); + if (quiet_multiple) exit(0); fatal("another duct holds the lockfile"); } sysdie("fcntl F_SETLK lockfile %s", path_lock); @@ -2261,22 +2264,23 @@ void op_periods_boolfalse(const Option *o, const char *val) { } static const Option options[]= { +{'f',"feedfile", &feedfile, op_string }, +{'q',"quiet-multiple", &quiet_multiple, op_booltrue, 1 }, + { 0, "max-connections", &max_connections op_integer }, +{ 0, "max-queue-per-conn", &max_queue_per_conn op_integer }, + + { 0, "streaming", &try_stream, op_booltrue, 1 }, { 0, "no-streaming", &try_stream, op_boolfalse, 1 }, -{'h',"host", &remote_host, op_string }, {'P',"port", &port op_integer }, { 0, "inndconf", &inndconffile, op_string }, -{'f',"feedfile", &feedfile, op_string }, -{'q',"quiet-multiple", &quiet_if_locked, op_booltrue, 1 }, -{ 0, "no-quiet-multiple", &quiet_if_locked, op_boolfalse, 1 }, {'d',"daemon", &become_daemon, op_booltrue, 1 }, { 0, "no-daemon", &become_daemon, op_boolfalse, 1 }, { 0, "no-check-proportion", &nocheck_thresh_pct, op_double }, { 0, "no-check-filter", &nocheck_decay_articles, op_double }, -{ 0, "max-queue-size", &max_queue_per_conn op_integer }, { 0, "reconnect-interval", &reconnect_delay_periods, op_periods_rndup }, { 0, "flush-retry-interval", &flushfail_retry_periods, op_periods_rndup }, { 0, "connection-timeout", &connection_timeout, op_seconds }, @@ -2336,10 +2340,8 @@ int main(int argc, char **argv) { if (!arg) badusage("need site name argument"); sitename= arg; - if ((arg= *++argv)) { - if (remote_host) badusage("must not specify -h and also host as argument"); + if ((arg= *++argv)) remote_host= arg; - } if (*++argv) badusage("too many non-option arguments"); diff --git a/doc/man/innduct.8 b/doc/man/innduct.8 index 56cd806..c791d9f 100644 --- a/doc/man/innduct.8 +++ b/doc/man/innduct.8 @@ -11,17 +11,18 @@ innduct \- quickly and reliably stream Usenet articles to remote site implements NNTP peer-to-peer news transmission including the streaming extensions, for sending news articles to a remote site. -One instance of innduct is run for each peer site. innduct manages -its interaction with innd so that articles are transmitted quickly, -and manages the retransmission its own backlog. innduct includes the +You need to run one instance of innduct for each peer site. innduct +manages its interaction with innd, including flushing the feed as +appropriate, etc., so that articles are transmitted quickly, and +manages the retransmission of its own backlog. innduct includes the locking necessary to avoid multiple simutaneous invocations. -By default, innduct reads the default feed file name corresponding to +By default, innduct reads the default feedfile corresponding to the site .I site -(as specified in -.IR newsfeeds (5)) -and feeds it vian NNTP, streaming if possible, to the host +(is +.IR pathoutgoing / site ) +and feeds it via NNTP, streaming if possible, to the host .IR fqdn . If @@ -30,13 +31,42 @@ is not specified, it defaults to .IR site . Logging is sent to syslog. -.SH OPTIONS +.SH GENERAL OPTIONS .TP -.B \-h fqdn -Specifies the domain name of the host to connect to via NNTP. The -default is the site name. The domain name may be specified with -.B \-h -or as a 2nd non-option argument, but not both. +.BI \-f feedfile +Specifies +.IR feedfile . +If the specified value ends in a +.B / +it is taken as a directory to use as if it were +.I pathoutgoing +and the actual feed file used is +.IR specified_feedfile / site . +.TP +.BR \-q | \-\-quiet-multiple +Makes innduct silently exit if another innduct holds the lock for the +site. Without \fB-q\fR, this causes a fatal error to be logged. +.SH TUNING OPTIONS +You should not normally need to adjust these. +.TP +.BI \-\-max-connections= max +Restricts the maximum number of simultaneous NNTP connections used by +for each site to +.IR max . +The default is 10. There is no global limit on the number of +connections. +.TP +.BI \-\-max-queue-per-conn= max +Restricts the maximum number of outstanding articles queued on any +particular connection +.IR max . +The default is 200. +.TP +.BI \-\-max-queue-per-conn= max +Restricts the maximum number of outstanding articles queued on any +particular connection +.IR max . +The default is 200. .SH FILES .IX Header "FILES" .IP \fIpathoutgoing\fR/\fIsite\fR -- 2.30.2