<para><command>&dhpackage;</command> allows to configure the
nbd-server.</para>
- <para>The default configuration file is
- <filename>@sysconfdir@/nbd-server/config</filename>, but this
- can be varied with the <option>-C</option> option to
- <command>nbd-server</command>(1).
+ <para>While
+ <filename>@sysconfdir@/nbd-server/config</filename> is the default
+ configuration file, this can be varied with the <option>-C</option>
+ option to <command>nbd-server</command>(1).
</para>
<para>
The configuration file consists of section header lines, comment
</listitem>
</varlistentry>
</variablelist>
+ </refsect1>
<refsect1>
<title>OPTIONS FOR EXPORT SECTIONS</title>
</listitem>
</varlistentry>
<varlistentry>
- <term><option>autoreadonly</option></term>
- <listitem>
- <para>Optional; boolean.</para>
- <para>
- If this option is set to true, then
- <command>nbd-server</command> will automatically switch to
- readonly if it cannot write to the file.
- </para>
- <para>Does not have a corresponding command-line
- argument</para>
- <para>TODO: verify whether this option actually works as
- documented. I have a feeling I've been terribly
- stupid.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
<term><option>copyonwrite</option></term>
<listitem>
<para>
<listitem>
<para>Required; string.</para>
<para>
- The name of the file that will be exported. This must be a
- fully-qualified path and filename; relative paths are not
- allowed.
+ The name of the file (or block device) that will be
+ exported. This must be a fully-qualified path and filename;
+ relative paths are not allowed.
</para>
<para>
Note that <command>nbd-server</command> will only try to
</listitem>
</varlistentry>
<varlistentry>
+ <term>listenaddr</term>
+ <listitem>
+ <para>Optional; string</para>
+ <para>If this option is set, it should contain the local IP
+ address on which we should listen to
+ <command>nbd-client</command>(8) connections. If it is not
+ set, <command>nbd-server</command> will listen to all
+ local IPv4 and IPv6 addresses. To limit to IPv6, specify the
+ address as "::". To limit to IPv4, specify as "0.0.0.0". It
+ is not possible to specify more than one IP address
+ here.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
<term><option>multifile</option></term>
<listitem>
<para>Optional; boolean.</para>
form
<replaceable>exportname</replaceable>.<replaceable>integer</replaceable>,
with <replaceable>exportname</replaceable> being the
- filename that would otherwise have been used (after
- name transformation for virtualization, if any, has been
+ filename that would otherwise have been used (after name
+ transformation for virtualization, if any, has been
performed) and <replaceable>integer</replaceable> an
integer number, starting with 0 and ending when no more
files can be found.
</listitem>
</varlistentry>
<varlistentry>
+ <term><option>sdp</option></term>
+ <listitem>
+ <para>Optional; boolean.</para>
+ <para>
+ When this option is enabled, <command>nbd-server</command>
+ will use the Socket Direct Protocol (SDP) to serve the
+ export, rather than just IP. This is faster, but requires
+ special hardware (usually something like InfiniBand) and
+ support in the kernel.
+ </para>
+ <para>
+ Additionally, support for this option must be enabled at
+ compile time, using the <option>--enable-sdp</option> option
+ to the <command>configure</command> script. If this option
+ is found in a configuration file and
+ <command>nbd-server</command> does not have support for SDP,
+ then <command>nbd-server</command> will exit with an error
+ message.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>sync</option></term>
+ <listitem>
+ <para>Optional; boolean.</para>
+ <para>When this option is enabled,
+ <command>nbd-server</command> will call an fsync() after every
+ write to the backend storage. Calling fsync() increases
+ reliability in case of an unclean shutdown of nbd-server; but,
+ depending on the file system used on the nbd-server side, may
+ degrade performance. The use of this option isn't always
+ necessary; e.g., on ext3 filesystems, it is recommended that
+ it is <emphasis>not</emphasis> enabled, since it seriously
+ reduces performance on ext3 filesystems while not
+ importantly impacting reliability.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
<term><option>sparse_cow</option></term>
<listitem>
<para>Optional; boolean.</para>
</para>
</listitem>
</varlistentry>
- <varlistentry>
- <term><option>prerun</option></term>
- <listitem>
- <para>Optional; string</para>
- <para>
- If specified, then this command will be ran after a
- client has connected to the server (and has been
- accepted), but before the server starts serving. If
- the command contains the literal string '%s', then
- this string will be replaced by the filename of the
- file which nbd-server wants to export.
- </para>
- <para>
- This is useful to create export files on the fly, or
- to verify that a file can be used for export, to
- write something to a log file, or similar.
- </para>
- <para>
- If the command runs with a non-zero exit status,
- then nbd-server will assume the export will fail,
- and refuse to serve it.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>postrun</option></term>
- <listitem>
- <para>Optional; string</para>
- <para>
- If specified, then it is assumed to be a command
- that will be ran when a client has
- disconnected. This can be useful to clean up
- whatever <option>prerun</option> has set up, to log
- something, or similar.
- </para>
- <para>
- If the literal string '%s' is present in the
- command, it will be replaced by the file name that
- has just been closed.
- </para>
- <para>
- In contrast to the <option>prerun</option> option,
- the exit state of <option>postrun</option> is
- <emphasis>ignored</emphasis>.
- </para>
- </listitem>
- </varlistentry>
</variablelist>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><option>prerun</option></term>
+ <listitem>
+ <para>Optional; string</para>
+ <para>
+ If specified, then this command will be ran after a
+ client has connected to the server (and has been
+ accepted), but before the server starts serving. If
+ the command contains the literal string '%s', then
+ this string will be replaced by the filename of the
+ file which nbd-server wants to export.
+ </para>
+ <para>
+ This is useful to create export files on the fly, or
+ to verify that a file can be used for export, to
+ write something to a log file, or similar.
+ </para>
+ <para>
+ If the command runs with a non-zero exit status,
+ then nbd-server will assume the export will fail,
+ and refuse to serve it.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>postrun</option></term>
+ <listitem>
+ <para>Optional; string</para>
+ <para>
+ If specified, then it is assumed to be a command
+ that will be ran when a client has
+ disconnected. This can be useful to clean up
+ whatever <option>prerun</option> has set up, to log
+ something, or similar.
+ </para>
+ <para>
+ If the literal string '%s' is present in the
+ command, it will be replaced by the file name that
+ has just been closed.
+ </para>
+ <para>
+ In contrast to the <option>prerun</option> option,
+ the exit state of <option>postrun</option> is
+ <emphasis>ignored</emphasis>.
+ </para>
+ </listitem>
+ </varlistentry>
</variablelist>
-
+
</refsect1>
<refsect1>
<title>SEE ALSO</title>