chiark / gitweb /
option for no inotify; manpage fix
[innduct.git] / doc / man / buffchan.8
1 .\" $Revision: 5909 $
2 .TH BUFFCHAN 8
3 .SH NAME
4 buffchan \- buffered file-writing backend for InterNetNews
5 .SH SYNOPSIS
6 .B buffchan
7 [
8 .B \-b
9 ]
10 [
11 .BI \-c " lines"
12 ]
13 [
14 .BI \-C " seconds"
15 ]
16 [
17 .BI \-d " directory"
18 ]
19 [
20 .BI \-f " num_fields"
21 ]
22 [
23 .BI \-m " map"
24 ]
25 [
26 .BI \-p " pidfile"
27 ]
28 [
29 .BI \-l " lines"
30 ]
31 [
32 .BI \-L " seconds"
33 ]
34 [
35 .B \-r
36 ]
37 [
38 .BI \-s " filename_format"
39 ]
40 [
41 .B \-u
42 ]
43 .SH DESCRIPTION
44 .I Buffchan
45 reads lines from standard input and copies certain fields in
46 each line into files named by other fields within the line.
47 .I Buffchan
48 is intended to be called by
49 .IR innd (8)
50 as an exploder feed.
51 .SH OPTIONS
52 .TP
53 .B \-b
54 Once
55 .I buffchan
56 opens a file it keeps it open.
57 The input must therefore never specify more files than the
58 number of available descriptors can keep open.
59 If the ``\fB\-b\fP'' flag is used, the program will allocate a buffer and
60 attach it to the file using
61 .IR setbuf (3).
62 .TP
63 .B \-c lines
64 If the ``\fB\-c\fP'' flag is used,
65 .I buffchan
66 will close, and re-open, a file after every
67 .I lines
68 lines are written to a file.
69 .TP
70 .B \-C seconds
71 Similarly, the ``\fB\-C\fP'' flag may be used to specify that all files should
72 be closed and re-opened every
73 .I seconds
74 seconds.
75 .TP
76 .B \-d directory
77 The ``\fB\-d\fP'' flag may be used to specify a directory the program should
78 change to before starting.
79 If this flag is used, then the default for the ``\fB\-s\fP'' flag is changed to
80 be a simple ``%s''.
81 .TP
82 .B \-f num_fields
83 Buffchan
84 input is interpreted as a sequence of lines.
85 Each line contains a fixed number of initial fields, followed by a
86 variable number of filename fields.
87 All fields in a line are separated by whitespace.
88 The default number of initial fields is one; the ``\fB\-f\fP''
89 flag may be
90 used to specify a different number of fields.
91 .TP
92 .B \-m map
93 Map files specify short names as aliases for domain names; see
94 .IR filechan (8)
95 for details and an example.
96 .TP
97 .B \-p pidfile
98 If the ``\fB\-p\fP'' flag is used, the program will write a line containing
99 its process ID (in text) to the specified file.
100 .TP
101 .B \-l lines
102 If the ``\fB\-l\fP'' flag is used,
103 .I buffchan
104 will call
105 .IR fflush (3)
106 after every
107 .I lines
108 lines are written to a file.
109 .TP
110 .B \-L seconds
111 If the ``\fB\-L\fP'' flag is used,
112 all files will be flushed every
113 .I n
114 seconds.
115 .TP
116 .B \-r
117 By default, the program sends its error messages to
118 .IR <pathlog\ in\ inn.conf>/errlog .
119 To suppress this redirection and send error messages to standard error,
120 use the ``\fB\-r\fP'' flag.
121 .TP
122 .B \-s filename_format
123 After the initial fields, each remaining field names a file to
124 write.
125 The ``\fB\-s\fP'' flag may be used to specify a format string that maps
126 the field to a file name.
127 This is a
128 .IR sprintf (3)
129 format string which should have a single ``%s'' parameter which will be given
130 the contents of a non-initial field.
131 The default value is
132 .IR <pathoutgoing\ in\ inn.conf>/%s .
133 See the description of this flag in
134 .IR filechan (8).
135 .TP
136 .B \-u
137 If the ``\fB\-u\fP'' flag is used, the program will request unbuffered output.
138 .PP
139 .I Buffchan
140 can be invoked as an exploder feed (see
141 .IR newsfeeds (5)).
142 As such, if a line starts with an exclamation point it will be treated
143 as a command.
144 There are three commands, described below:
145 .TP
146 .B flush
147 The ``flush'' command closes and re-opens
148 all open files; ``flush\ xxx'' which flushes only the specified site.
149 These are analogous to the
150 .IR ctlinnd (8)
151 \&``flush'' command, 
152 and can be achieved by doing a ``send\ "flush\ xxx"'' command.
153 Applications can tell that the ``flush'' has completed by renaming the
154 file before issuing the command;
155 .I buffchan
156 has completed the command when the original filename re-appears.
157 If
158 .I <$ac_cv_func_fchmod in config.cache>
159 is ``yes'', then 
160 .I buffchan
161 also changes the access permissions of the file from read-only for
162 everyone to read-write for owner and group as it flushes or closes each
163 output file.  It will change the modes back to read-only if it re-opens
164 the same file.
165 .TP
166 .B drop
167 The ``drop'' command is similar to the ``flush'' command except that no
168 files are re-opened.
169 If given an argument, then the specified site is dropped, otherwise all
170 sites are dropped.
171 (Note that the site will be restarted if the input stream mentions the
172 site.)
173 When a
174 .I ctlinnd
175 \&``drop site'' command is sent,
176 .I innd
177 will automatically forward the command to
178 .I buffchan
179 for sites listed as funnels feeding into this exploder.
180 To drop all sites, use the
181 .I ctlinnd
182 \&``send buffchan-site drop'' command.
183 .TP
184 .B readmap
185 The map file (specified with the ``\-m'' flag) is reloaded.
186 .SH HISTORY
187 Written by Rich $alz <rsalz@uunet.uu.net> for InterNetNews.
188 .de R$
189 This is revision \\$3, dated \\$4.
190 ..
191 .R$ $Id: buffchan.8 5909 2002-12-03 05:17:18Z vinocur $
192 .SH "SEE ALSO"
193 ctlinnd(8),
194 filechan(8),
195 inn.conf(5),
196 innd(8),
197 newsfeeds(5).