/*
- * warning if no inotify
- * inotify not working ?
- * some per-conn info thing for control
-
* todo
-
- * - actually do something with readable on control master
- * - option for realsockdir
- * - option for filepoll
- * - option for no inotify
+ * - inotify not working ?
+ * - some per-conn info thing for control
* - manpage: document control master stuff
- * - manpage: innconf is used for communicating with innd
- * - debug this:
+ *
+ * debugging rune:
* build-lfs/backends/innduct --no-daemon -f `pwd`/fee sit dom
*/
static const char *sitename, *remote_host;
static const char *feedfile, *realsockdir="/tmp/innduct.control";
static int quiet_multiple=0;
-static int become_daemon=1;
+static int become_daemon=1, try_filemon=1;
static int try_stream=1;
static int port=119;
static const char *inndconffile;
static int max_queue_per_conn=200;
static int target_max_feedfile_size=100000;
static int period_seconds=60;
+static int filepoll_seconds=5;
static int connection_setup_timeout=200;
static int inndcomm_flush_timeout=100;
uid_t self= geteuid();
if (!S_ISDIR(stab.st_mode) ||
stab.st_uid != self ||
- stab.st_mode & 0077) {
+ stab.st_mode & 0007) {
warn("no control socket, because real socket directory"
" is somehow wrong (ISDIR=%d, uid=%lu (exp.%lu), mode %lo)",
!!S_ISDIR(stab.st_mode),
{'q',"quiet-multiple", 0, &quiet_multiple, op_setint, 1 },
{0,"no-daemon", 0, &become_daemon, op_setint, 0 },
{0,"no-streaming", 0, &try_stream, op_setint, 0 },
+{0,"no-filemon", 0, &try_filemon, op_setint, 0 },
{'C',"inndconf", "F", &inndconffile, op_string },
{'P',"port", "PORT", &port, op_integer },
+{0,"ctrl-sock-dir", 0, &realsockdir, op_string },
{0,"help", 0, 0, help },
{0,"max-connections", "N", &max_connections, op_integer },
{0,"feedfile-flush-size","BYTES", &target_max_feedfile_size, op_integer },
{0,"period-interval", "TIME", &period_seconds, op_seconds },
-{0,"connection-timeout", "TIME", &connection_setup_timeout, op_seconds },
-{0,"stuck-flush-timeout","TIME", &inndcomm_flush_timeout, op_seconds },
+{0,"connection-timeout", "TIME", &connection_setup_timeout, op_seconds },
+{0,"stuck-flush-timeout", "TIME", &inndcomm_flush_timeout, op_seconds },
+{0,"feedfile-poll", "TIME", &filepoll_seconds, op_seconds },
{0,"no-check-proportion", "PERCENT", &nocheck_thresh, op_double },
{0,"no-check-response-time","ARTICLES", &nocheck_decay, op_double },
control_init();
- if (!filemon_method_init()) {
- warn("filemon: no file monitoring available, polling");
- every(5,0,filepoll);
+ int filemon_ok= 0;
+ if (!try_filemon) {
+ notice("filemon: suppressed by command line option, polling");
+ } else {
+ filemon_ok= filemon_method_init();
+ if (!filemon_ok)
+ warn("filemon: no file monitoring available, polling");
}
+ if (!filemon_ok)
+ every(filepoll_seconds,0,filepoll);
every(period_seconds,1,period);
Do not try to use the streaming extensions to NNTP (for use eg if the
peer can't cope when we send MODE STREAM).
.TP
+.BI \-\-no-filemon
+Do not try to use the file change monitoring support to watch for
+writes by innd to the feed file; poll it instead. (If file monitoring
+is not compiled in, this option just downgrades the log message which
+warns about this situation.)
+.TP
.BR \-C | \-\-inndconf= \fIFILE\fR
Read
.I FILE
instead of the default
.BR inn.conf .
.TP
+.BI \-\-ctrl-sock-dir= DIR
+Bind the real control socket to a unique filename in
+.IR DIR .
+A symlink will be made pointing to the actual file used, named
+.IB feedfile _control
+in the same directory as
+.IR feedfile ,
+but since
+.IR feedfile 's
+path may be too long for an AF_UNIX socket path, innduct always
+creates the sockets in this dedicated directory which is expected to
+have a short path. 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
.TP
.BI \-\-period-interval= PERIOD-INTERVAL
Specifies wakup interval and period granularity.
-innduct wakes up every PERIOD-INTERVAL to do various housekeeping
-checks. Also, many of the timeout and rescan intervals (those
-specified in this manual as
+innduct wakes up every
+.I PERIOD-INTERVAL
+to do various housekeeping checks. Also, many of the timeout and
+rescan intervals (those specified in this manual as
+.IR PERIOD )
+are rounded up to the next multiple of
+.IR PERIOD-INTERVAL .
.TP
.BI \-\-connection-timeout= TIME
How long to allow for a connection setup attempt before giving up.
up. The default is
.BR 100s .
.TP
+.BI \-\-feedfile-poll= TIME
+How often to poll the feedfile for new articles written by innd
+if file monitoring
+.RI ( inotify
+or equivalent) is not available. (When file monitoring is available,
+there is no need for periodic checks and we wake immediately up
+whenever the feedfile changes.)
+The default is
+.BR 5s .
+.TP
.BI \-\-no-check-proportion= PERCENT
If the moving average of the proportion of articles being accepted
(rather than declined) by the peer exceeds this value, innduct uses
.IX Item inn.conf
Used to find
.IR pathoutgoing
-if none is specified, and also for
+if none is specified, for finding how to communicate with innd,
+and also for
.IR sourceaddress
and/or
.IR sourceaddress6 .