| 1 | # $Id: Run.pm,v 1.7 2005-04-11 12:08:51 mike Exp $ | ||
| 2 | |||
| 3 | package Net::Z3950::DBIServer::Run; | ||
| 4 | use strict; | ||
| 5 | |||
| 6 | |||
| 7 | =head1 NAME | ||
| 8 | |||
| 9 | Net::Z3950::DBIServer::Run - Invoking the zSQLgate Server | ||
| 10 | |||
| 11 | |||
| 12 | =head1 SYNOPSIS | ||
| 13 | |||
| 14 | C<zSQLgate> | ||
| 15 | I<config-file> | ||
| 16 | I<[YAZ-options]> | ||
| 17 | I<[listener]> | ||
| 18 | ... | ||
| 19 | |||
| 20 | =head1 DESCRIPTION | ||
| 21 | |||
| 22 | C<zSQLgate> | ||
| 23 | provides an Z39.50 interface to your relational databases. | ||
| 24 | That is, it provides a generic gateway between the Z39.50 Information | ||
| 25 | Retrieval protocol and pretty much any relational database you | ||
| 26 | care to mention. | ||
| 27 | |||
| 28 | This document describes how to invoke the C<zSQLgate> server from the | ||
| 29 | command-line: what the options do and how to specify listener | ||
| 30 | addresses. For other information, including details of the | ||
| 31 | configuration file format, see L<::zSQLgate> and the linked pages. | ||
| 32 | |||
| 33 | |||
| 34 | =head1 OPTIONS | ||
| 35 | |||
| 36 | Besides the mandatory configuration-file name, the following options | ||
| 37 | may be provided on the command-line. These are all inherited from the | ||
| 38 | YAZ back-end server on which zSQLgate is built. | ||
| 39 | |||
| 40 | =over 4 | ||
| 41 | |||
| 42 | =item -a I<APDUfile> | ||
| 43 | |||
| 44 | APDU file. Specifies a file for dumping APDUs (for diagnostic | ||
| 45 | purposes). The special name ``C<->'' sends output to the standard | ||
| 46 | error stream. It's better then even money that you'll never, ever do | ||
| 47 | this. (Though now I've said that, you'll try it just to spite me.) | ||
| 48 | |||
| 49 | =cut | ||
| 50 | |||
| 51 | =item -S | ||
| 52 | |||
| 53 | Static. Prevents the server from C<fork()>ing on connection requests. | ||
| 54 | This can be useful for debugging, but is not recommended for real | ||
| 55 | operation: although the server is asynchronous and non-blocking, there | ||
| 56 | are potential efficiency gains in having separate server processes for | ||
| 57 | each client connection: for example, a single intensive back-end | ||
| 58 | operation on the behalf of one client will not cause simpler requests | ||
| 59 | from other clients to be delayed. | ||
| 60 | |||
| 61 | =item -l I<logFile> | ||
| 62 | |||
| 63 | Log file. Specifies a file to which to write logging messages, which | ||
| 64 | by default go to the standard error stream. | ||
| 65 | |||
| 66 | =item -v I<verbosity> | ||
| 67 | |||
| 68 | Verbosity. Specifies what information to write to the log file. The | ||
| 69 | I<verbosity> specification should be a comma-separated list of one or | ||
| 70 | more of the following words: | ||
| 71 | |||
| 72 | fatal, debug, warn, log, all, none | ||
| 73 | |||
| 74 | The default logging level is C<fatal,warn,log> - that is, everything | ||
| 75 | except the very verbose C<debug> messages. | ||
| 76 | |||
| 77 | =item -u I<userName> | ||
| 78 | |||
| 79 | User. Sets the running server's real and effective user IDs to that | ||
| 80 | of the specified user. This is useful if you need the server to start | ||
| 81 | running as C<root> so it can bind to a privileged port, but you don't | ||
| 82 | otherwise want or need to run as C<root>. | ||
| 83 | |||
| 84 | =item -w I<dir> | ||
| 85 | |||
| 86 | Working directory. Tells the server to run in the specified | ||
| 87 | directory. | ||
| 88 | |||
| 89 | =item -i | ||
| 90 | |||
| 91 | Inetd. Used when running C<zSQLgate> from the C<inetd> server. The | ||
| 92 | default is to run in standalone mode. | ||
| 93 | |||
| 94 | =item -t I<minutes> | ||
| 95 | |||
| 96 | Timeout. Tells the server to unilaterally close client connections | ||
| 97 | after they are idle for the specified number of minutes. | ||
| 98 | |||
| 99 | =cut | ||
| 100 | |||
| 101 | ### does timeout=0 => forever? | ||
| 102 | |||
| 103 | =item -k I<Kb> | ||
| 104 | |||
| 105 | Sets the maximum record size and message size to the specified number | ||
| 106 | of kilobytes. You should really never need this. | ||
| 107 | |||
| 108 | =item -1 | ||
| 109 | |||
| 110 | One-shot mode. Tells the server to serve a single connection, then | ||
| 111 | exit immediately. This can be useful when debugging, but not in | ||
| 112 | normal use. | ||
| 113 | |||
| 114 | =item -T | ||
| 115 | |||
| 116 | Threads. Asks the server to use threads, rather than multiple | ||
| 117 | processes, on systems where that is an option. On Windows NT, this is | ||
| 118 | the default (and indeed only) mode. | ||
| 119 | |||
| 120 | =item -s | ||
| 121 | |||
| 122 | SR. Instructs the server to use the obsolete ISO SR protocol rather than | ||
| 123 | Z39.50. I don't think there's any reason to do this now, if there | ||
| 124 | ever was, but it's there for completeness. | ||
| 125 | |||
| 126 | =item -z | ||
| 127 | |||
| 128 | Z39.50. Instructs the server to speak Z39.50 rather than the | ||
| 129 | obsolete ISO SR protocol. This is the default. | ||
| 130 | |||
| 131 | =cut | ||
| 132 | |||
| 133 | ### I don't honestly understand what these are | ||
| 134 | #=item -c I<string> | ||
| 135 | # | ||
| 136 | #Sets C<configname> to the specified I<string>. | ||
| 137 | # | ||
| 138 | #=item -d I<something> | ||
| 139 | # | ||
| 140 | #Sets C<daemonname> to the specified I<string>. | ||
| 141 | |||
| 142 | =back | ||
| 143 | |||
| 144 | |||
| 145 | =head1 LISTENER SPECIFICATIONS | ||
| 146 | |||
| 147 | Following any options on the command line, one or more listener | ||
| 148 | specifications may be provided. A listener specification consists of | ||
| 149 | a transport mode followed by a colon (C<:>) followed by a listener | ||
| 150 | address. The transport mode may be either C<tcp> or C<ssl>. The | ||
| 151 | former is the default and may be omitted. The | ||
| 152 | latter is experimental; please don't hassle me if you can't get it to | ||
| 153 | work. (I know I<I> can't.) | ||
| 154 | |||
| 155 | The address itself consists of a hostname or IP number, optionally | ||
| 156 | followed by a colon and a port number; if the port number is omitted, | ||
| 157 | it defaults to 210, the standard Z39.50 port. The special hostname | ||
| 158 | C<@> is mapped to the address C<INADDR_ANY>, which causes the server | ||
| 159 | to listen on any local interface. This is nearly always what you | ||
| 160 | want. | ||
| 161 | |||
| 162 | For example, to start C<zSQLgate> in static (single-process) mode | ||
| 163 | with logging going to the C<zsql.log> file and listening for | ||
| 164 | connections on ports 210 and 3950, use: | ||
| 165 | |||
| 166 | zSQLgate -S -l zsql.log tcp:@ @:3950 | ||
| 167 | |||
| 168 | |||
| 169 | =head1 AUTHOR | ||
| 170 | |||
| 171 | Mike Taylor E<lt>mike@miketaylor.org.ukE<gt> | ||
| 172 | |||
| 173 | First version Saturday 2nd February 2002. | ||
| 174 | |||
| 175 | =cut |