chiark / gitweb /
option for no inotify; manpage fix
[innduct.git] / backends / innduct.c
index 9014309a89b4126fa5277a14e6563c7467cb14ce..36eeda82a7b820395bbbaeb60019e654ef06658a 100644 (file)
@@ -3,7 +3,6 @@
  *  - inotify not working ?
  *  - some per-conn info thing for control
  *  - option for realsockdir
  *  - inotify not working ?
  *  - some per-conn info thing for control
  *  - option for realsockdir
- *  - option for no inotify
  *  - manpage: document control master stuff
  *
  * debugging rune:
  *  - 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 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 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 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;
 
 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   },
 {'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           },
 {'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();
 
 
   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);
 
 
   every(period_seconds,1,period);