32ce37f851d8a69efba022b04dbdf2b1b0c1e716
[nbd.git] / man / nbd-server.5.in.sgml
1 <!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
2
3 <!-- Process this file with docbook-to-man to generate an nroff manual
4      page: `docbook-to-man manpage.sgml > manpage.1'.  You may view
5      the manual page with: `docbook-to-man manpage.sgml | nroff -man |
6      less'.  A typical entry in a Makefile or Makefile.am is:
7
8 manpage.1: manpage.sgml
9         docbook-to-man $< > $@
10   -->
11
12   <!-- Fill in your name for FIRSTNAME and SURNAME. -->
13   <!ENTITY dhfirstname "<firstname>Wouter</firstname>">
14   <!ENTITY dhsurname   "<surname>Verhelst</surname>">
15   <!-- Please adjust the date whenever revising the manpage. -->
16   <!ENTITY dhdate      "<date>$Date: 2006-10-18 15:01:57 +0200 (wo, 18 okt 2006) $</date>">
17   <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
18        allowed: see man(7), man(1). -->
19   <!ENTITY dhsection   "<manvolnum>5</manvolnum>">
20   <!ENTITY dhemail     "<email>wouter@debian.org</email>">
21   <!ENTITY dhusername  "Wouter Verhelst">
22   <!ENTITY dhucpackage "<refentrytitle>NBD-SERVER</refentrytitle>">
23   <!ENTITY dhpackage   "$sysconfdir/nbd-server/config">
24
25   <!ENTITY debian      "<productname>Debian GNU/Linux</productname>">
26   <!ENTITY gnu         "<acronym>GNU</acronym>">
27 ]>
28
29 <refentry>
30   <refentryinfo>
31     <address>
32       &dhemail;
33     </address>
34     <author>
35       &dhfirstname;
36       &dhsurname;
37     </author>
38     <copyright>
39       <year>2006</year>
40       <holder>&dhusername;</holder>
41     </copyright>
42     &dhdate;
43   </refentryinfo>
44   <refmeta>
45     &dhucpackage;
46
47     &dhsection;
48   </refmeta>
49   <refnamediv>
50     <refname>&dhpackage;</refname>
51
52     <refpurpose>configuration file for nbd-server</refpurpose>
53   </refnamediv>
54   <refsynopsisdiv>
55     <cmdsynopsis>
56       <command>&dhpackage; </command>
57
58     </cmdsynopsis>
59   </refsynopsisdiv>
60   <refsect1>
61     <title>DESCRIPTION</title>
62
63     <para>This file allows to configure the nbd-server.</para>
64
65     <para>While
66       <filename>$sysconfdir/nbd-server/config</filename> is the default
67       configuration file, this can be varied with the <option>-C</option>
68       option to <command>nbd-server</command>(1).
69     </para>
70     <para>
71       The configuration file consists of section header lines, comment
72       lines, and option lines.
73     </para>
74     <para>
75       A section header is a unique name that
76       is enclosed in square brackets ("[" and "]"). A section header
77       denotes the beginning of a section; a section continues until
78       the next section or the end of the file, whichever is first. The
79       first section in the configuration file must be called
80       <option>generic</option>, and is used for global options that
81       apply to more than one export. This section must always be
82       present, even if it holds no options. Every other section
83       defines one export; the names of these sections are not
84       important, except that you should take care to make sure that
85       each section name is unique. The section name is used as the name
86       for the export in case the client connects with a name rather than
87       a port to specify an export, and must therefore be unique.
88     </para>
89     <para>
90       A comment line is a line that starts with optional whitespace,
91       followed by a pound sign ("#"), and continues until the end of
92       the line. Comments may <emphasis>not</emphasis> be used on
93       option lines or section header lines.
94     </para>
95     <para>
96       An option line is a line that starts with an option name,
97       followed by an equals sign ("="), followed by the option
98       value. An option can be of type string, of type integer, or of
99       type boolean. The value of a boolean option can be denoted with
100       either true or false (so not yes, no, on, off, 1, or 0). All
101       booleans default to false unless specified otherwise. No value
102       may be quoted; always enter it directly. For a string option,
103       leading whitespace is stripped (but trailing whitespace is not).
104     </para>
105
106   </refsect1>
107   <refsect1>
108     <title>OPTIONS FOR SECTION [generic]</title>
109
110     <!-- These are in alphabetical order, please keep it that way -->    
111     <variablelist>
112       <varlistentry>
113         <term><option>group</option></term>
114         <listitem>
115           <para>
116             Optional; string.
117           </para>
118           <para>
119             The name of the group this server must run as. If this
120             parameter is not specified, then nbd-server will not
121             attempt to change its GID (so the GID it runs as will be
122             the primary group of the user who starts nbd-server). If
123             it is specified, then nbd-server will change its GID after
124             opening ports, but before accepting connections or opening
125             files.
126           </para>
127         </listitem>
128       </varlistentry>
129       <varlistentry>
130         <term><option>user</option></term>
131         <listitem>
132           <para>
133             Optional; string.
134           </para>
135           <para>
136             The name of the user this server must run as. If this
137             parameter is not specified, then nbd-server will not
138             attempt to change its UID (so the UID it runs as will be
139             the user who starts nbd-server). If it is specified, then
140             nbd-server will change its UID after opening ports, but
141             before accepting connections or opening files.
142           </para>
143         </listitem>
144       </varlistentry>
145       <varlistentry>
146         <term><option>oldstyle</option></term>
147         <listitem>
148           <para>
149             Optional; boolean
150           </para>
151           <para>
152             If this option is set to true, nbd-server will export all
153             exports on a separate port with the old (pre-2.9.17)
154             handshake protocol. In that case, the 'port' option for
155             individual exports is mandatory.
156           </para>
157           <para>
158             If the option is set to false, the 'port' option for
159             individual exports is optional (and will be ignored if
160             specified). The server will only export devices on the
161             standard port.
162           </para>
163           <para>
164             For upgrades from pre-2.9.17 versions of nbd, it may be
165             appropriate to enable the oldstyle parameter until all
166             clients have been converted to using name-based exports.
167           </para>
168           <para>
169             Note that exports specified on the command line will
170             always use the old handshake protocol and will not allow
171             name-based exports.
172           </para>
173           <para>
174             Also note that even if this parameter is set to true, all
175             exports will also be made available using the new handshake
176             protocol; it is not possible to switch that off. The reason
177             for this is that the old style protocol will eventually be
178             deprecated, and this option is only available to allow for
179             smooth upgrades.
180           </para>
181         </listitem>
182       </varlistentry>
183       <varlistentry>
184         <term><option>listenaddr</option></term>
185         <listitem>
186           <para>
187             Optional; string
188           </para>
189           <para>If this option is set, it should contain the local IP
190           address on which we should listen to
191           <command>nbd-client</command>(8) connections. If it is not
192             set, <command>nbd-server</command> will listen to all
193           local IPv4 and IPv6 addresses. To limit to IPv6, specify the
194           address as "::". To limit to IPv4, specify as "0.0.0.0". It
195           is not possible to specify more than one IP address
196           here.</para>
197         </listitem>
198       </varlistentry
199     </variablelist>
200   </refsect1>
201   <refsect1>
202     <title>OPTIONS FOR EXPORT SECTIONS</title>
203
204     <!-- These are in alphabetical order, please keep it that way -->
205     <variablelist>
206       <varlistentry>
207         <term><option>authfile</option></term>
208         <listitem>
209           <para>
210             Optional; string; default
211             <filename>$sysconfdir/nbd-server/allow</filename>.
212           </para>
213           <para>
214             The name of the authorization file for this export. This
215             file should contain one line per IP-address, or per
216             network (which must be specified in CIDR-style
217             <option><replaceable>network</replaceable>/<replaceable>masklen</replaceable></option>)
218             and must not contain empty lines. If the file
219             does not exist, everyone is allowed to connect. If the
220             file exists but is empty, nobody is allowed to
221             connect. Otherwise, <command>nbd-server</command> will
222             only allow clients to connect whose IP-adres is listed in
223             this file.
224           </para>
225           <para>Corresponds to the <option>-l</option> option on the
226           command line</para>
227         </listitem>
228       </varlistentry>
229       <varlistentry>
230         <term><option>copyonwrite</option></term>
231         <listitem>
232           <para>
233             Optional; boolean.
234           </para>
235           <para>
236             Whether this is a copy-on-write export. If it is, then any
237             writes to this export will not be written to the master
238             file, but to a separate file which will be removed upon
239             disconnect. The result of using this option is that
240             nbd-server will be somewhat slower, and that any writes will
241             be lost upon disconnect.
242           </para>
243           <para>Corresponds to the <option>-c</option> option on the
244             command line</para>
245         </listitem>
246       </varlistentry>
247       <varlistentry>
248         <term><option>exportname</option></term>
249         <listitem>
250           <para>Required; string.</para>
251           <para>
252             The name of the file (or block device) that will be
253             exported. This must be a fully-qualified path and filename;
254             relative paths are not allowed.
255           </para>
256           <para>
257             Note that <command>nbd-server</command> will only try to
258             find and open the exported file when a client actually
259             connects; as a result, <command>nbd-server</command> must
260             be able to open and read this file
261             <emphasis>after</emphasis> changing to the user and group
262             that have been specified by use of the
263             <option>user</option> and <option>group</option> options;
264             also, <command>nbd-server</command> will only detect
265             errors in this option upon connection of a client.
266           </para>
267           <para>When specified on the command line, this should be the
268             second argument.
269           </para>
270         </listitem>
271       </varlistentry>
272       <varlistentry>
273         <term><option>filesize</option></term>
274         <listitem>
275           <para>Optional; integer; default autodetected.</para>
276           <para>
277             Disable autodetection of file or block device size, and
278             forcibly specify a size. Sizes must be specified in
279             bytes. If the <option>multifile</option> option is in
280             effect, this option specifies the size of the
281             <emphasis>entire</emphasis> export, not of individual
282             files.
283           </para>
284           <para>When specified on the command line, this should be the
285             third argument.
286           </para>
287         </listitem>
288       </varlistentry>
289       <varlistentry>
290         <term><option>flush</option></term>
291         <listitem>
292           <para>Optional; boolean.</para>
293           <para>When this option is enabled,
294             <command>nbd-server</command> will inform the client that it
295             supports and desires to be sent flush requests when the
296             elevator layer receives them. Receipt of a flush request
297             will cause an fdatasync() (or, if the sync option is set,
298             an fsync()) on the backend storage. This increases
299             reliability in the case of an unclean shutdown at
300             the expense of a degradation of performance. This option
301             will have no effect unless supported by the client.
302           </para>
303         </listitem>
304       </varlistentry>
305       <varlistentry>
306         <term><option>fua</option></term>
307         <listitem>
308           <para>Optional; boolean.</para>
309           <para>When this option is enabled,
310             <command>nbd-server</command> will inform the client that it
311             supports and desires to be sent fua (force unit access) commands
312             when the elevator layer receives them. Receipt of a force unit
313             access command will cause the specified command to be synced
314             to backend storage using sync_file_range() if supported, or
315             fdatasync() otherwise. This increases
316             reliability in the case of an unclean shutdown at
317             the expense of a degradation of performance. This option
318             will have no effect unless supported by the client.
319           </para>
320         </listitem>
321       </varlistentry>
322       <varlistentry>
323         <term>listenaddr</term>
324         <listitem>
325           <para>
326             Optional; string
327           </para>
328           <para>
329             If the 'oldstyle' global parameter is specified, works
330             similarly to the global listenaddr parameter, but for the
331             individual port of this particular export. If the 'oldstyle'
332             parameter is not set, this parameter is ignored.
333           </para>
334         </listitem>
335       </varlistentry>
336       <varlistentry>
337         <term><option>maxconnections</option></term>
338         <listitem>
339           <para>Optional; integer</para>
340           <para>
341             If specified, then it limits the number of opened connections for
342             this export.
343           </para>
344         </listitem>
345       </varlistentry>
346       <varlistentry>
347         <term><option>multifile</option></term>
348         <listitem>
349           <para>Optional; boolean.</para>
350           <para>
351             If this option is set to true, then
352             <command>nbd-server</command> will search for files of the
353             form
354             <replaceable>exportname</replaceable>.<replaceable>integer</replaceable>,
355             with <replaceable>exportname</replaceable> being the
356             filename that would otherwise have been used (after name
357             transformation for virtualization, if any, has been
358             performed) and <replaceable>integer</replaceable> an
359             integer number, starting with 0 and ending when no more
360             files can be found.
361           </para>
362           <para>
363             The size of the individual files will be autodetected,
364             <emphasis>even</emphasis> if the <option>filesize</option>
365             option has been specified.
366           </para>
367           <para>
368             Corresponds to the <option>-m</option> option on the
369             command line.
370           </para>
371         </listitem>
372       </varlistentry>
373       <varlistentry>
374         <term><option>port</option></term>
375         <listitem>
376           <para>Required if 'oldstyle' global parameter is set; integer.</para>
377           <para>
378             The port on which this export is to be served using the
379             old-style handshake protocol.
380           </para>
381           <para>
382             This parameter only makes sense when the 'oldstyle'
383             parameter is set to true in the 'generic' section. If that
384             parameter is not set, but this parameter is found in an
385             export section, then nbd-server will issue a warning upon
386             startup but should otherwise continue to function correctly.
387           </para>
388           <para>
389             It is not possible to combine multiple exports on the same
390             port using the old style handshake. Please use the new style
391             handshake for that purpose.
392           </para>
393           <para>
394             When specified on the command line, this should be the
395             first argument.
396           </para>
397         </listitem>
398       </varlistentry>
399       <varlistentry>
400         <term><option>postrun</option></term>
401         <listitem>
402           <para>Optional; string</para>
403           <para>
404             If specified, then it is assumed to be a command
405             that will be ran when a client has
406             disconnected. This can be useful to clean up
407             whatever <option>prerun</option> has set up, to log
408             something, or similar.
409           </para>
410           <para>
411             If the literal string '%s' is present in the
412             command, it will be replaced by the file name that
413             has just been closed.
414           </para>
415           <para>
416             In contrast to the <option>prerun</option> option,
417             the exit state of <option>postrun</option> is
418             <emphasis>ignored</emphasis>.
419           </para>
420         </listitem>
421       </varlistentry>
422       <varlistentry>
423         <term><option>prerun</option></term>
424         <listitem>
425           <para>Optional; string</para>
426           <para>
427             If specified, then this command will be ran after a
428             client has connected to the server (and has been
429             accepted), but before the server starts serving. If
430             the command contains the literal string '%s', then
431             this string will be replaced by the filename of the
432             file which nbd-server wants to export.
433           </para>
434           <para>
435             This is useful to create export files on the fly, or
436             to verify that a file can be used for export, to
437             write something to a log file, or similar.
438           </para>
439           <para>
440             If the command runs with a non-zero exit status,
441             then nbd-server will assume the export will fail,
442             and refuse to serve it.
443           </para>
444         </listitem>
445       </varlistentry>
446       <varlistentry>
447         <term><option>readonly</option></term>
448         <listitem>
449           <para>Optional; boolean.</para>
450           <para>
451             Disallow writes to the device. If this option is
452             specified, <command>nbd-server</command> will issue an
453             error to any client that tries to write to the device.
454           </para>
455           <para>
456             Use of this option in conjunction with
457             <option>copyonwrite</option> is possible, but silly.
458           </para>
459           <para>Corresponds to the <option>-r</option> option on the
460           command line.</para>
461         </listitem>
462       </varlistentry>
463       <varlistentry>
464         <term><option>rotational</option></term>
465         <listitem>
466           <para>Optional; boolean.</para>
467           <para>When this option is enabled,
468             <command>nbd-server</command> will inform the client that 
469             it would prefer it to send requests in elevator (i.e., optimized) order, perhaps
470             because it has a backing store and no local elevator. By
471             default, the client uses QUEUE_FLAG_NONROT, which effectively
472             restricts the function of the elevator to block merges. By
473             specifying this flag on the server, the client will not use
474             QUEUE_FLAG_NONROT, meaning the client elevator will perform
475             normal elevator ordering of I/O requests. Note that even when
476             the backing store is on rotating media, it is not normally
477             necessary to specify this flag, as the server's elevator
478             algorithm will be used. This flag is only required where
479             the server will not be using an elevator algorithm or where
480             the elevator algorithm is effectively neutered (e.g. with
481             the sync option set). This option will have no effect unless
482             supported by the client.
483           </para>
484         </listitem>
485       </varlistentry>
486       <varlistentry>
487         <term><option>sdp</option></term>
488         <listitem>
489           <para>Optional; boolean.</para>
490           <para>
491             When this option is enabled, <command>nbd-server</command>
492             will use the Socket Direct Protocol (SDP) to serve the
493             export, rather than just IP. This is faster, but requires
494             special hardware (usually something like InfiniBand) and
495             support in the kernel.
496           </para>
497           <para>
498             Additionally, support for this option must be enabled at
499             compile time, using the <option>--enable-sdp</option> option
500             to the <command>configure</command> script. If this option
501             is found in a configuration file and
502             <command>nbd-server</command> does not have support for SDP,
503             then <command>nbd-server</command> will exit with an error
504             message.
505           </para>
506         </listitem>
507       </varlistentry>
508       <varlistentry>
509         <term><option>sparse_cow</option></term>
510         <listitem>
511           <para>Optional; boolean.</para>
512           <para>
513             When this option is enabled, <command>nbd-server</command>
514             will use sparse files to implement the copy-on-write
515             option; such files take up less space then they appear to,
516             which allows <command>nbd-server</command> to handle the
517             file as if it was just as large as the block device it's
518             for.
519           </para>
520           <para>
521             If this option is disabled, <command>nbd-server</command>
522             will map every newly written block to the end of the
523             copy-on-write file, which means that
524             <command>nbd-server</command> will have to lseek(2) to the
525             right position after every 4096-byte block.
526           </para>
527           <para>
528             Using this option may be faster when much is being written
529             during a connection.
530           </para>
531         </listitem>
532       </varlistentry>
533       <varlistentry>
534         <term><option>sync</option></term>
535         <listitem>
536           <para>Optional; boolean.</para>
537           <para>When this option is enabled,
538             <command>nbd-server</command> will call an fsync() after every
539             write to the backend storage. Calling fsync() increases
540             reliability in case of an unclean shutdown of nbd-server; but,
541             depending on the file system used on the nbd-server side, may
542             degrade performance. The use of this option isn't always
543             necessary; e.g., on ext3 filesystems, it is recommended that
544             it is <emphasis>not</emphasis> enabled, since it seriously
545             reduces performance on ext3 filesystems while not
546             importantly impacting reliability.
547           </para>
548         </listitem>
549       </varlistentry>
550       <varlistentry>
551         <term><option>timeout</option></term>
552         <listitem>
553           <para>Optional; integer; default 0</para>
554           <para>
555             How many seconds a connection may be idle for this
556             export. When a connection is idle for a longer time,
557             <command>nbd-server</command> will forcibly disconnect the
558             connection. If you specify 0 (the default), then a
559             connection may be idle forever.
560           </para>
561           <para>
562             Corresponds to the <option>-a</option> option on the
563             command line
564           </para>
565         </listitem>
566       </varlistentry>
567       <varlistentry>
568         <term><option>transactionlog</option></term>
569         <listitem>
570           <para>Optional; string</para>
571           <para>
572             If specified, then this pathname is used to generate a transaction
573             log. A transaction log is a binary file consisting of the requests
574             sent to and the replies received by the server, but excluding any
575             data (so, for a write command, it records the offset and length
576             of the write but not the data written). It is therefore relatively
577             safe to distribute to a third party. Note that the transaction log
578             does not include the negotiation sequence. Transaction logs are
579             mainly useful for debugging. The program
580             <emphasis>nbd-tester-client</emphasis> distributed with the source
581             to this program can reply a transaction log against a server and
582             perform a data integrity test. Note that the transaction log is
583             written to for every client opened. If it is necessary to maintain
584             separate transaction logs for each client, the
585             <emphasis>prerun</emphasis> script should rename the transaction log
586             (which will just have been opened in order to avoid transaction logs
587             overwriting eachother. This action should be race-free.
588           </para>
589         </listitem>
590       </varlistentry>
591       <varlistentry>
592         <term><option>virtstyle</option></term>
593         <listitem>
594           <para>Optional; string; default "ipliteral"</para>
595           <para>
596             Defines the style of virtualization. Virtualization allows
597             one to create one export that will serve a different file
598             depending on the IP address that is connecting. When
599             virtualization is active, the
600             <replaceable>exportname</replaceable> parameter needs to
601             contain the string '%s'; this will then be replaced by the
602             IP address of the client connecting, in accordance with the
603             option selected here. The result of this transformation is
604             then used as the filename to be opened.
605           </para>
606           <para>
607             There are four types of virtualization that
608             <command>nbd-server</command> supports:
609           </para>
610           <variablelist>
611             <varlistentry>
612               <term><option>none</option></term>
613               <listitem>
614                 <para>
615                   No virtualization. Will attempt to open the filename
616                   as it was written, even if it contains '%s' in the
617                   name.
618                 </para>
619               </listitem>
620             </varlistentry>
621             <varlistentry>
622               <term><option>ipliteral</option></term>
623               <listitem>
624                 <para>
625                   The %s is replaced by the IP address of the connecting
626                   host is used as-is.  For IPv4, this is done in
627                   dotted-quad notation; for IPv6, in hexadecimal form
628                   with leading zeros omitted.
629                 </para>
630                 <para>
631                   As an example, if a client connects from 192.168.1.100
632                   and <option>exportname</option> is specified as
633                   <filename>/export/%s</filename>, then nbd-server will
634                   attempt to serve
635                   <filename>/export/192.168.1.100</filename>. For IPv6,
636                   with a client connecting from 2001:6f8:32f::39, the
637                   filename would be
638                   <filename>/export/2001:6f8:32f:0:0:0:0:39</filename>
639                 </para>
640               </listitem>
641             </varlistentry>
642             <varlistentry>
643               <term><option>iphash</option></term>
644               <listitem>
645                 <para>
646                   Same as above, except that
647                   <command>nbd-server</command> will replace the dots
648                   in the IP address by forward slashes ('/'); in the
649                   same example, <command>nbd-server</command> would
650                   open <filename>/export/192/168/1/100</filename>
651                   instead.
652                 </para>
653                 <para>
654                   Since there are no dots in most IPv6 addresses, the
655                   effect of using this option when IPv6 is in use is
656                   indistinguishable from the ipliteral option. It was
657                   thought that having to create an eight-deep directory
658                   structure would not be as useful.
659                 </para>
660               </listitem>
661             </varlistentry>
662             <varlistentry>
663               <term><option>cidrhash</option></term>
664               <listitem>
665                 <para>
666                   This option requires one to add a space and a number
667                   after it. <command>nbd-server</command> will use the
668                   number as a network mask in CIDR style, and use that
669                   as a hash cutoff point. In the above example, if
670                   <option>virtstyle</option> has been specified as
671                   <constant>cidrhash 16</constant>, then
672                   <command>nbd-server</command> will try to open
673                   <filename>/export/192.168.0.0/192.168.1.100</filename>;
674                   if <option>virtstyle</option> were specified as
675                   <constant>cidrhash 26</constant>, then
676                   <command>nbd-server</command> will try to open
677                   <filename>/export/192.168.1.64/192.168.1.100</filename>.
678                 </para>
679                 <para>For IPv6, in the above example, with
680                 <constant>cidrhash 42</constant>, the filename would
681                 be
682                 <filename>/export/2001:32f:6c0:0:0:0:0:0/2001:32f:6f8:0:0:0:0:39</filename>.</para>
683               </listitem>
684             </varlistentry>
685           </variablelist>
686         </listitem>
687       </varlistentry>
688     </variablelist>
689     
690   </refsect1>
691   <refsect1>
692     <title>SEE ALSO</title>
693
694     <para>nbd-server (1), nbd-client (8)</para>
695       
696
697   </refsect1>
698   <refsect1>
699     <title>AUTHOR</title>
700     <para>The NBD kernel module and the NBD tools were originally
701       written by Pavel Machek (pavel@ucw.cz)</para>
702
703     <para>The Linux kernel module is now maintained by Paul Clements
704       (Paul.Clements@steeleye.com), while the userland tools are
705       maintained by &dhusername; (&dhemail;)</para>
706
707     <para>On The Hurd there is a regular translator available to perform the
708       client side of the protocol, and the use of
709       <command>nbd-client</command> is not required. Please see the
710       relevant documentation for more information.</para>
711
712     <para>This manual page was written by &dhusername; (&dhemail;) for
713       the &debian; system (but may be used by others).  Permission is
714       granted to copy, distribute and/or modify this document under
715       the terms of the <acronym>GNU</acronym> General Public License,
716       version 2, as published by the Free Software Foundation.</para>
717
718   </refsect1>
719   <refsect1>
720     <title>EXAMPLES</title>
721     <para>A simple <command>nbd-server</command> configuration file
722       would look like this:</para>
723     <programlisting>
724       [generic]
725       [export]
726           exportname = /export/blkdev
727           port = 12345
728     </programlisting>
729     <para>For increased security, one might want to create an
730       authorization file, and set the UID and GID to run as:</para>
731     <programlisting>
732       [generic]
733           user = nbd
734           group = nbd
735       [export]
736           exportname = /export/blkdev
737           port = 12345
738           authfile = $sysconfdir/nbd-server/allow
739     </programlisting>
740     <para>With $sysconfdir/nbd-server/allow containing the following:</para>
741     <programlisting>
742       127.0.0.1
743       192.168.0.0/8
744       192.168.1.1
745     </programlisting>
746   </refsect1>
747 </refentry>
748
749 <!-- Keep this comment at the end of the file
750 Local variables:
751 mode: sgml
752 sgml-omittag:t
753 sgml-shorttag:t
754 sgml-minimize-attributes:nil
755 sgml-always-quote-attributes:t
756 sgml-indent-step:2
757 sgml-indent-data:t
758 sgml-parent-document:nil
759 sgml-default-dtd-file:nil
760 sgml-exposed-tags:nil
761 sgml-local-catalogs:nil
762 sgml-local-ecat-files:nil
763 End:
764 -->