1BUFFCHAN(8)               InterNetNews Documentation               BUFFCHAN(8)
2
3
4

NAME

6       buffchan - Buffered file-writing backend for INN
7

SYNOPSIS

9       buffchan [-bru] [-c lines] [-C seconds] [-d directory] [-f num-fields]
10       [-l lines] [-L seconds] [-m map] [-p pid-file] [-s format]
11

DESCRIPTION

13       buffchan reads lines from standard input and copies the initial fields
14       in each line to the files named by the remaining fields on the line.
15       buffchan is intended to be called by innd as an exploder feed.
16
17       The input is interpreted as a sequence of lines.  Each line contains a
18       fixed number of initial fields, followed by a variable number of
19       filename fields.  All fields in a line are separated by whitespace and
20       do not contain any whitespace.  The default number of initial fields is
21       one.
22
23       For each line of input, buffchan writes the initial fields, separated
24       by a space and followed by a newline, to each of the files named in the
25       filename fields.  The output files are kept open and are only flushed
26       or closed based on the schedule given by the -c, -C, -l, and -L
27       options.
28
29       As an exploder feed (see newsfeeds(5) for an explanation), buffchan
30       interprets lines beginning with an exclamation point as commands.
31       Besides "!begin" (which only marks the start of the feed), there are
32       three supported commands:
33
34       !flush [site]
35           The flush command closes and reopens all open files.  An optional
36           site can be specified, in which case buffchan flushes only that
37           file.  This command is analogous to the "ctlinnd flush" command.
38           This command can be sent via innd using "ctlinnd send buffchan-site
39           'flush site'".
40
41           Applications can tell that flush has completed by renaming the file
42           before issuing the command.  When the original file name has
43           reappeared, the flush is complete.  If fchmod(3) is available,
44           buffchan also changes the file to read-only while it's actively
45           writing to it and changes it back to read/write once it has been
46           closed.  It will change the mode back to read-only only if it
47           reopens the same file.
48
49       !drop [site]
50           The drop command is similar to the flush command, except that no
51           files are reopened.  If given an argument, only the specified site
52           is dropped; otherwise, all sites are dropped.  (Note that a site
53           will be restarted if the input stream mentions the site again.)
54
55           When a "ctlinnd drop site" command is sent, innd will automatically
56           forward the command to buffchan if the site is listed as a funnel
57           feeding into the buffchan exploder.  To drop all sites, use
58           "ctlinnd send buffchan-site drop".
59
60       !readmap
61           The map file specified with the -m option, if given, will be
62           reloaded.
63
64       Once buffchan opens a file, it keeps it open (in the absence of a drop
65       command).  The input must therefore never specify more files than the
66       maximum number of files a process may open.
67

OPTIONS

69       -b  Force the output to be buffered.  (This is generally the default,
70           but it may depend on the operating system.)  If -b is given, a
71           buffer size of BUFSIZ (a constant of the system standard I/O
72           library) is used.
73
74       -c lines
75           If the -c flag is given, buffchan will close and reopen a file
76           after every lines lines are written to the file.
77
78       -C seconds
79           If the -C flag is given, buffchan will close and reopen a file if
80           it has been open for more than seconds seconds.
81
82       -d directory
83           This flag may be used to specify a directory the program should
84           change to before starting.  If this flag is used, the default for
85           the -s flag (see below) is changed to be a simple %s (in other
86           words, output files are considered to be relative to directory).
87
88       -f num-fields
89           By default, each line is expected to contain one fixed field
90           followed by some number of filename fields.  If this flag is given,
91           num-fields will be used as the number of initial fixed fields.
92
93       -l lines
94           If the -l flag is given, buffchan will flush the output after every
95           lines lines are written to a file.
96
97       -L seconds
98           If the -L flag is given, buffchan will flush each output file every
99           seconds seconds.
100
101       -m map
102           Map files translate the names in the filename fields on each line
103           into filenames that should be used instead.  It's used primarily
104           when short names are used in newsfeeds, but the output files should
105           use the full domain names of remote peers.
106
107           In the map file, blank lines and lines starting with a number sign
108           ("#") are ignored.  All other lines should have two host names
109           separated by a colon.  The first field is the name that may appear
110           in the input stream; the second field names the file to be used
111           when the name in the first field appears.  For example:
112
113               # This is a comment
114               uunet:news.uu.net
115               foo:foo.com
116               munnari:munnari.oz.au
117
118       -p pid-file
119           If the -p option is given, buffchan will write a line containing
120           its process ID (in text) to the specified file when it starts.
121
122       -r  By default, buffchan sends its error messages to pathlog/errlog.
123           To suppress this redirection and send error messages to standard
124           error, use the -r flag.
125
126       -s  The -s flag may be used to specify a format that maps a filename
127           from the filename fields at the end of each line to an actual
128           filename.  This is a sprintf(3) format string that should contain a
129           single instance of %s, which will be replaced with the value of the
130           filename field (possibly after mapping with the map file from -m).
131           The default value is pathoutgoing/%s.
132
133       -u  If the -u flag is used, the output will be unbuffered.
134

EXAMPLES

136       If buffchan is invoked with "-f 2" and given the following input:
137
138           news/software/b/132 <1643@munnari.oz.au> foo uunet
139           news/software/b/133 <102060@litchi.foo.com> uunet munnari
140           comp/sources/unix/2002 <999@news.foo.com> foo uunet munnari
141
142       Then the file foo will have these lines:
143
144           news/software/b/132 <1643@munnari.oz.au>
145           comp/sources/unix/2002 <999@news.foo.com>
146
147       the file munnari will have these lines:
148
149           news/software/b/133 <102060@litchi.foo.com>
150           comp/sources/unix/2002 <999@news.foo.com>
151
152       and the file uunet will have these lines:
153
154           news/software/b/132 <1643@munnari.oz.au>
155           news/software/b/133 <102060@litchi.foo.com>
156           comp/sources/unix/2002 <999@news.foo.com>
157

HISTORY

159       Written by Rich $alz <rsalz@uunet.uu.net> for InterNetNews.  Converted
160       to POD by Russ Allbery <rra@stanford.edu>.
161
162       $Id: buffchan.pod 7851 2008-05-26 19:33:08Z iulius $
163

SEE ALSO

165       ctlinnd(8), filechan(8), inn.conf(5), innd(8), newsfeeds(5).
166
167
168
169INN 2.5.2                         2010-08-11                       BUFFCHAN(8)
Impressum