chiark / gitweb /
option for no inotify; manpage fix
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Fri, 30 Apr 2010 22:54:33 +0000 (23:54 +0100)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Fri, 30 Apr 2010 22:54:33 +0000 (23:54 +0100)
backends/innduct.c
doc/man/innduct.8

index 9014309a89b4126fa5277a14e6563c7467cb14ce..36eeda82a7b820395bbbaeb60019e654ef06658a 100644 (file)
@@ -3,7 +3,6 @@
  *  - inotify not working ?
  *  - some per-conn info thing for control
  *  - option for realsockdir
- *  - option for no inotify
  *  - manpage: document control master stuff
  *
  * debugging rune:
@@ -325,7 +324,7 @@ static oop_rd_call peer_rd_err, peer_rd_ok;
 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;
@@ -490,7 +489,7 @@ static InputFile *main_input_file, *flushing_input_file, *backlog_input_file;
 static int sm_period_counter;
 
 /* initialisation to 0 is good */
-static int until_connect, until_backlog_nextscan, until_backup_filepoll;
+static int until_connect, until_backlog_nextscan;
 static double accept_proportion;
 static int nocheck, nocheck_reported;
 
@@ -3103,6 +3102,7 @@ static const Option innduct_options[]= {
 {'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,"help",               0,       0,                         help           },
@@ -3261,10 +3261,16 @@ int main(int argc, char **argv) {
 
   control_init();
 
-  if (!filemon_method_init()) {
-    warn("filemon: no file monitoring available, polling");
-    every(filepoll_seconds,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);
 
index 06822cce0d1867c88348d703197d1d2cfc6e54c3..64fd7bb71b8704c44df9cdd8d1e90b3a875ccf57 100644 (file)
@@ -94,6 +94,12 @@ Do not daemonise.  innduct runs in the foreground and all messages
 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
@@ -142,9 +148,13 @@ working.  The default is
 .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.