Fix leaks
[nbd.git] / nbd-client.8.sgml
index a5d1a70..635fc23 100644 (file)
@@ -13,7 +13,7 @@ manpage.1: manpage.sgml
   <!ENTITY dhfirstname "<firstname>Wouter</firstname>">
   <!ENTITY dhsurname   "<surname>Verhelst</surname>">
   <!-- Please adjust the date whenever revising the manpage. -->
-  <!ENTITY dhdate      "<date>september 19, 2001</date>">
+  <!ENTITY dhdate      "<date>$Date$</date>">
   <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
        allowed: see man(7), man(1). -->
   <!ENTITY dhsection   "<manvolnum>8</manvolnum>">
@@ -56,25 +56,27 @@ manpage.1: manpage.sgml
     <cmdsynopsis>
       <command>&dhpackage;</command>
       <arg><option>bs=<replaceable>blocksize</replaceable></option></arg>
+      <arg><option>timeout=<replaceable>seconds</replaceable></option></arg>
       <arg choice=plain><option><replaceable>host</replaceable></option></arg>
       <arg choice=plain><option><replaceable>port</replaceable></option></arg>
       <arg choice=plain><option><replaceable>nbd-device</replaceable></option></arg>
+      <arg><option>-sdp</option></arg>
       <arg><option>-swap</option></arg>
+      <arg><option>-persist</option></arg>
+      <arg><option>-nofork</option></arg>
     </cmdsynopsis>
     <cmdsynopsis>
       <command>&dhpackage;</command>
       <arg choice=plain><option>-d <replaceable>nbd-device</replaceable></option></arg>
     </cmdsynopsis>
+    <cmdsynopsis>
+      <command>&dhpackage;</command>
+      <arg choice="plain"><option>-c <replaceable>nbd-device</replaceable></option></arg>
+    </cmdsynopsis>
   </refsynopsisdiv>
   <refsect1>
     <title>DESCRIPTION</title>
 
-    <para>This manual page documents briefly the
-      <command>&dhpackage;</command> command.</para>
-
-    <para>This manual page was written for the &debian; distribution
-      because the original program does not have a manual page.</para>
-
     <para>With <command>&dhpackage;</command>, you can connect to a
     server running <command>nbd-server</command>, thus using raw
     diskspace from that server as a blockdevice on the local
@@ -85,7 +87,7 @@ manpage.1: manpage.sgml
     either in the kernel, or as a module, you can connect to an NBD
     server and use its exported file through a block special file with
     major mode 43.</para>
-
+    
   </refsect1>
   <refsect1>
     <title>OPTIONS</title>
@@ -103,8 +105,18 @@ manpage.1: manpage.sgml
       <varlistentry>
        <term><option>host</option></term>
        <listitem>
-         <para>The hostname of the machine running
-           <command>nbd-server</command>.</para>
+         <para>The hostname or IP address of the machine running
+           <command>nbd-server</command>. Since 2.9.15, the NBD
+           utilities support IPv6.</para>
+       </listitem>
+      </varlistentry>
+      <varlistentry>
+       <term><option>timeout=<replaceable>seconds</replaceable></option></term>
+       <listitem>
+         <para>Set the connection timeout to "seconds". For this to
+         work, you need a kernel with support for the NBD_SET_TIMEOUT
+         ioctl; this was introduced into Linus' tree on 2007-10-11,
+         and will be part of kernel 2.6.24.</para>
        </listitem>
       </varlistentry>
       <varlistentry>
@@ -122,15 +134,60 @@ manpage.1: manpage.sgml
        </listitem>
       </varlistentry>
       <varlistentry>
+       <term>-c</term>
+       <listitem>
+         <para>Check whether the specified nbd device is
+         connected.</para>
+         <para>If the device is connected, &dhpackage; will exit
+         with an exit state of 0 and print the PID of the &dhpackage;
+         instance that connected it to stdout.
+         <para>If the device is not
+         connected or does not exist (for example because the nbd
+         module was not loaded), &dhpackage; will exit with an exit
+         state of 1 and not print anything on stdout.</para>
+         <para>If an error occurred, &dhpackage; will exit with an exit
+         state of 2, and not print anything on stdout either.</para>
+       </listitem>
+      </varlistentry>
+      <varlistentry>
+       <term>-d</term>
+       <listitem>
+         <para>Disconnect the specified nbd device from the
+         server</para>
+       </listitem>
+      </varlistentry>
+      <varlistentry>
+       <term>-persist</term>
+       <listitem>
+         <para>When this option is specified, &dhpackage; will
+           immediately try to reconnect an nbd device if the
+           connection ever drops unexpectedly due to a lost
+           server or something similar.</para>
+       </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>-sdp</option></term>
+       <listitem>
+         <para>Connect to the server using the Socket Direct Protocol
+           (SDP), rather than IP. See nbd-server(1) for details.
+         </para>
+       </listitem>
+      </varlistentry>
+      <varlistentry>
        <term><option>-swap</option></term>
        <listitem>
          <para>Specifies that this NBD device will be used as
-           swapspace. If you intend to do that, please use this
-           option to prevent deadlocks. You'll need a special kernel
-           patch, available at NBD's homepage:
-           http://atrey.karlin.mff.cuni.cz/~pavel</para>
+         swapspace. This option attempts to prevent deadlocks by
+         performing mlockall() at an appropriate time. It does not
+         however guarantee that such deadlocks can be avoided.</para>
        </listitem>
       </varlistentry>
+      <varlistentry>
+        <term><option>-nofork</option></term>
+       <listitem>
+         <para>Specifies that the NBD client should not detach and
+         daemonize itself. This is mostly useful for debugging.</para>
+      </varlistentry>
     </variablelist>
   </refsect1>
   <refsect1>
@@ -141,21 +198,21 @@ manpage.1: manpage.sgml
       <listitem>
        <para>To connect to a server running on port 2000 at host
          "server.domain.com", using the client's block special file
-         "/dev/nd0":</para>
+         "/dev/nb0":</para>
        <para><command>nbd-client server.domain.com 2000
-         /dev/nd0</command></para>
+         /dev/nb0</command></para>
       </listitem>
       <listitem>
        <para>To connect to a server running on port 2001 at host
          "swapserver.domain.com", using the client's block special
-         file "/dev/nd1", for swap purposes:</para>
-       <para><command>nbd-client swapserver.domain.com 2001 /dev/nd1
+         file "/dev/nb1", for swap purposes:</para>
+       <para><command>nbd-client swapserver.domain.com 2001 /dev/nb1
          -swap</command></para>
       </listitem>
       <listitem>
        <para>To disconnect the above connection again (after making
          sure the block special file is not in use anymore):</para>
-       <para><command>nbd-client -d /dev/nd1</command></para>
+       <para><command>nbd-client -d /dev/nb1</command></para>
       </listitem>
     </itemizedlist>
   </refsect1>