From: Ian Jackson Date: Fri, 30 Apr 2010 22:54:33 +0000 (+0100) Subject: option for no inotify; manpage fix X-Git-Tag: innduct-0.1~88 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=innduct.git;a=commitdiff_plain;h=dffdf70592b1040409e1ba0e9a93874c8597213c;hp=015f3bd758797652cfb0086dbf741b490ef18de6 option for no inotify; manpage fix --- diff --git a/backends/innduct.c b/backends/innduct.c index 9014309..36eeda8 100644 --- a/backends/innduct.c +++ b/backends/innduct.c @@ -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); diff --git a/doc/man/innduct.8 b/doc/man/innduct.8 index 06822cc..64fd7bb 100644 --- a/doc/man/innduct.8 +++ b/doc/man/innduct.8 @@ -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.