Document more yazproxy command line options. Bug #412.
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 7 Sep 2005 09:28:46 +0000 (09:28 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 7 Sep 2005 09:28:46 +0000 (09:28 +0000)
doc/Makefile.am
doc/reference.xml
doc/yaz-proxy-man.sgml [deleted file]
doc/yaz-proxy-man.xml [new file with mode: 0644]
doc/yaz-proxy-ref.xml
src/yaz-proxy-main.cpp

index baa2bb2..04a0120 100644 (file)
@@ -1,4 +1,4 @@
-## $Id: Makefile.am,v 1.7 2004-04-22 18:47:02 adam Exp $
+## $Id: Makefile.am,v 1.8 2005-09-07 09:28:46 adam Exp $
 docdir=$(datadir)/doc/@PACKAGE@
 
 SUPPORTFILES = \
@@ -13,7 +13,7 @@ XMLFILES = \
  reference.xml \
  using.xml \
  yaz-proxy-ref.xml \
- yaz-proxy-man.sgml \
+ yaz-proxy-man.xml \
  license.xml \
  yazproxy.xml.in
  
@@ -50,8 +50,8 @@ EXTRA_DIST = $(SUPPORTFILES) $(XMLFILES) $(doc_DATA) $(man_MANS)
 $(HTMLFILES): $(XMLFILES)
        jade -E14 -D $(srcdir) -d yazhtml.dsl -t sgml $(srcdir)/xml.dcl $(TOP)
 
-yazproxy.8: yaz-proxy-man.sgml yaz-proxy-ref.xml
-       docbook2man $(srcdir)/yaz-proxy-man.sgml
+yazproxy.8: yaz-proxy-man.xml yaz-proxy-ref.xml
+       docbook2man $(srcdir)/yaz-proxy-man.xml
 
 yazproxy.php: $(XMLFILES)
        jade -E14 -D $(srcdir) -d yazphp.dsl -t sgml $(srcdir)/xml.dcl $(TOP)
index 1615287..dde1e4b 100644 (file)
    </section>
   </section>
   <section id="proxy-usage">
-   <title>Proxy Usage (man page)</title>
+   <title>Proxy Manual Pages</title>
    <refentry id="yazproxy-man">
     &yaz-proxy-ref;
    </refentry>
    <screen><![CDATA[
 <?xml version="1.0"?>
 <!-- XML Schema for YAZ proxy config file.
-    $Id: reference.xml,v 1.12 2005-05-14 14:15:50 mike Exp $
+    $Id: reference.xml,v 1.13 2005-09-07 09:28:46 adam Exp $
 -->
 <xs:schema
   xmlns:xs="http://www.w3.org/2001/XMLSchema"
diff --git a/doc/yaz-proxy-man.sgml b/doc/yaz-proxy-man.sgml
deleted file mode 100644 (file)
index e87e5e7..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
-     <!ENTITY yaz-proxy-ref SYSTEM "yaz-proxy-ref.xml">
-]>
-<!-- $Id: yaz-proxy-man.sgml,v 1.2 2004-04-11 14:38:53 adam Exp $ -->
-<refentry id="yazproxy">
-  &yaz-proxy-ref;
- <refsect1><title>SEE ALSO</title>
-  <para>
-   <citerefentry>
-    <refentrytitle>yaz</refentrytitle>
-    <manvolnum>7</manvolnum>
-   </citerefentry>
-   <citerefentry>
-    <refentrytitle>yaz-client</refentrytitle>
-    <manvolnum>1</manvolnum>
-   </citerefentry>
-  </para>
- </refsect1>
-</refentry>
- <!-- Keep this comment at the end of the file
- Local variables:
- mode: sgml
- sgml-omittag:t
- sgml-shorttag:t
- sgml-minimize-attributes:nil
- sgml-always-quote-attributes:t
- sgml-indent-step:1
- sgml-indent-data:t
- sgml-parent-document: nil
- sgml-local-catalogs: nil
- sgml-namecase-general:t
- End:
- -->
diff --git a/doc/yaz-proxy-man.xml b/doc/yaz-proxy-man.xml
new file mode 100644 (file)
index 0000000..0634c00
--- /dev/null
@@ -0,0 +1,33 @@
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
+     <!ENTITY yaz-proxy-ref SYSTEM "yaz-proxy-ref.xml">
+]>
+<!-- $Id: yaz-proxy-man.xml,v 1.1 2005-09-07 09:28:46 adam Exp $ -->
+<refentry id="yazproxy">
+  &yaz-proxy-ref;
+ <refsect1><title>SEE ALSO</title>
+  <para>
+   <citerefentry>
+    <refentrytitle>yaz</refentrytitle>
+    <manvolnum>7</manvolnum>
+   </citerefentry>
+   <citerefentry>
+    <refentrytitle>yaz-client</refentrytitle>
+    <manvolnum>1</manvolnum>
+   </citerefentry>
+  </para>
+ </refsect1>
+</refentry>
+ <!-- Keep this comment at the end of the file
+ Local variables:
+ mode: sgml
+ sgml-omittag:t
+ sgml-shorttag:t
+ sgml-minimize-attributes:nil
+ sgml-always-quote-attributes:t
+ sgml-indent-step:1
+ sgml-indent-data:t
+ sgml-parent-document: nil
+ sgml-local-catalogs: nil
+ sgml-namecase-general:t
+ End:
+ -->
index 209a178..da0c713 100644 (file)
  <cmdsynopsis>
   <command>yazproxy</command>
   <arg choice="opt">-a <replaceable>filename</replaceable></arg>
+  <arg choice="opt">-c <replaceable>config</replaceable></arg>
+  <arg choice="opt">-i <replaceable>seconds</replaceable></arg>
   <arg choice="opt">-l <replaceable>filename</replaceable></arg>
   <arg choice="opt">-m <replaceable>num</replaceable></arg>
-  <arg choice="opt">-v <replaceable>level</replaceable></arg>
-  <arg choice="opt">-t <replaceable>target</replaceable></arg>
+  <arg choice="opt">-n <replaceable>num</replaceable></arg>
   <arg choice="opt">-o <replaceable>level</replaceable></arg>
-  <arg choice="opt">-i <replaceable>seconds</replaceable></arg>
-  <arg choice="opt">-T <replaceable>seconds</replaceable></arg>
+  <arg choice="opt">-t <replaceable>target</replaceable></arg>
   <arg choice="opt">-p <replaceable>pidfile</replaceable></arg>
+  <arg choice="opt">-T <replaceable>seconds</replaceable></arg>
   <arg choice="opt">-u <replaceable>userid</replaceable></arg>
-  <arg choice="opt">-c <replaceable>config</replaceable></arg>
+  <arg choice="opt">-v <replaceable>level</replaceable></arg>
+  <arg choice="opt">-X</arg>
   <arg choice="req"><replaceable>host</replaceable>:<replaceable>port</replaceable></arg>
  </cmdsynopsis>
 </refsynopsisdiv>
      standard output.
     </para></listitem>
   </varlistentry>
+  <varlistentry><term>-c <replaceable>config</replaceable></term>
+   <listitem><para>
+     Specifies config filename. Configuration is in XML
+     and is only supported if the YAZ proxy is compiled with
+     libxml2.
+    </para></listitem>
+  </varlistentry>
+  <varlistentry><term>-i <replaceable>seconds</replaceable></term>
+   <listitem><para>
+     Specifies in seconds the idle time for communication between
+     client and proxy. If a connection is inactive for this long
+     it will be closed. Default: 600 seconds (10 minutes).
+    </para></listitem>
+  </varlistentry>
   <varlistentry><term>-l <replaceable>filename</replaceable></term>
    <listitem><para>
      Specifies the name of a file to which to write a log of the
   </varlistentry>
   <varlistentry><term>-m <replaceable>num</replaceable></term>
    <listitem><para>
-     Specifies the maximum number of connections to be cached
-     [default 50].
+     Specifies the maximum number of client connections to be
+     offered  [default 150].
     </para></listitem>
   </varlistentry>
-  <varlistentry><term>-v <replaceable>level</replaceable></term>
+  <varlistentry><term>-n <replaceable>num</replaceable></term>
    <listitem><para>
-     Sets the logging level. <replaceable>level</replaceable> is
-     a comma-separated list of members of the set
-     {<literal>fatal</literal>,<literal>debug</literal>,<literal>warn</literal>,<literal>log</literal>,<literal>malloc</literal>,<literal>all</literal>,<literal>none</literal>}.
-    </para></listitem>
-  </varlistentry>
-  <varlistentry><term>-t <replaceable>target</replaceable></term>
-   <listitem><para>
-     Specifies the default backend target to use when a client
-     connects that does not explicitly specify a target in its
-     <literal>initRequest</literal>.
+     Sets maximum number of open files to <replaceable>num</replaceable>.
+     This is only available on systems that offers the 
+     <function>setrlimit(2)</function> call.
     </para></listitem>
   </varlistentry>
   <varlistentry><term>-o <replaceable>level</replaceable></term>
      features. By default optimization is enabled (value 1).
     </para></listitem>
   </varlistentry>
-  <varlistentry><term>-i <replaceable>seconds</replaceable></term>
+  <varlistentry><term>-p <replaceable>pidfile</replaceable></term>
    <listitem><para>
-     Specifies in seconds the idle time for communication between
-     client and proxy. If a connection is inactive for this long
-     it will be closed. Default: 600 seconds (10 minutes).
+     When specified, yazproxy will create <replaceable>pidfile</replaceable>
+     with the process ID of the proxy. The pidfile will be generated
+     before the process changes identity (see option <literal>-u</literal>).
+    </para></listitem>
+  </varlistentry>
+  <varlistentry><term>-t <replaceable>target</replaceable></term>
+   <listitem><para>
+     Specifies the default backend target to use when a client
+     connects that does not explicitly specify a target in its
+     <literal>initRequest</literal>.
     </para></listitem>
   </varlistentry>
   <varlistentry><term>-T <replaceable>seconds</replaceable></term>
      it will be closed. Default: 600 seconds (10 minutes).
     </para></listitem>
   </varlistentry>
-  <varlistentry><term>-p <replaceable>pidfile</replaceable></term>
-   <listitem><para>
-     When specified, yazproxy will create <replaceable>pidfile</replaceable>
-     with the process ID of the proxy. The pidfile will be generated
-     before the process changes identity (see option <literal>-u</literal>).
-    </para></listitem>
-  </varlistentry>
   <varlistentry><term>-u <replaceable>userid</replaceable></term>
    <listitem><para>
      When specified, yazproxy will change identity to the user ID
      if specified by option <literal>-u</literal>.
     </para></listitem>
   </varlistentry>
-  <varlistentry><term>-c <replaceable>config</replaceable></term>
+  <varlistentry><term>-v <replaceable>level</replaceable></term>
    <listitem><para>
-     Specifies config filename. Configuration is in XML
-     and is only supported if the YAZ proxy is compiled with
-     libxml2.
+     Sets the logging level. <replaceable>level</replaceable> is
+     a comma-separated list of members of the set
+     {<literal>fatal</literal>,<literal>debug</literal>,<literal>warn</literal>,<literal>log</literal>,<literal>malloc</literal>,<literal>all</literal>,<literal>none</literal>}.
+    </para></listitem>
+  </varlistentry>
+  <varlistentry><term>-X</term>
+   <listitem><para>
+     Enables debugging mode for the proxy. When specified, the proxy will
+     not fork itself, thus any violations becomes fatal. Useful if
+     you run yazproxy inside <application>gdb</application>.
+     Don't run this in production.
     </para></listitem>
   </varlistentry>
  </variablelist>
index 01209d3..b5f3ffe 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: yaz-proxy-main.cpp,v 1.16 2005-06-25 15:58:33 adam Exp $
+/* $Id: yaz-proxy-main.cpp,v 1.17 2005-09-07 09:28:46 adam Exp $
    Copyright (c) 1998-2005, Index Data.
 
 This file is part of the yaz-proxy.
@@ -60,8 +60,10 @@ using namespace yazpp_1;
 
 void usage(char *prog)
 {
-    fprintf (stderr, "%s: [-c config] [-l log] [-a log] [-v level] [-t target] "
-             "[-u uid] [-p pidfile] @:port\n", prog);
+    fprintf (stderr, "%s: [-a log] [-c config]\n"
+             " [-i sec] [-l log] [-m num] [-n num] [-p pidfile]"
+             " [-t target] [-T sec] [-u uid]\n"
+             " [-v level] [-X] @:port\n", prog);
     exit (1);
 }
 
@@ -92,6 +94,9 @@ int args(Yaz_Proxy *proxy, int argc, char **argv)
             }
             addr = arg;
             break;
+        case 'a':
+            proxy->set_APDU_log(arg);
+            break;
         case 'c':
             err = proxy->set_config(arg);
             if (err == -2)
@@ -105,17 +110,8 @@ int args(Yaz_Proxy *proxy, int argc, char **argv)
                 exit(1);
             }
             break;
-        case 'a':
-            proxy->set_APDU_log(arg);
-            break;
-        case 't':
-            proxy->set_default_target(arg);
-            break;
-        case 'o':
-            proxy->option("optimize", arg);
-            break;
-        case 'v':
-            yaz_log_init_level (yaz_log_mask_str(arg));
+        case 'i':
+            proxy->set_client_idletime(atoi(arg));
             break;
         case 'l':
             yaz_log_init_file (arg);
@@ -124,27 +120,33 @@ int args(Yaz_Proxy *proxy, int argc, char **argv)
         case 'm':
             proxy->set_max_clients(atoi(arg));
             break;
-        case 'i':
-            proxy->set_client_idletime(atoi(arg));
-            break;
-        case 'T':
-            proxy->set_target_idletime(atoi(arg));
-            break;
         case 'n':
             no_limit_files = atoi(arg);
             break;
-        case 'X':
-            proxy->set_debug_mode(1);
-            debug = 1;
+        case 'o':
+            proxy->option("optimize", arg);
             break;
         case 'p':
             if (!pid_fname)
                 pid_fname = xstrdup(arg);
             break;
+        case 't':
+            proxy->set_default_target(arg);
+            break;
+        case 'T':
+            proxy->set_target_idletime(atoi(arg));
+            break;
         case 'u':
             if (!uid)
                 uid = xstrdup(arg);
             break;
+        case 'v':
+            yaz_log_init_level (yaz_log_mask_str(arg));
+            break;
+        case 'X':
+            proxy->set_debug_mode(1);
+            debug = 1;
+            break;
         default:
             usage(prog);
             return 1;