Maintenance Procedures YAZ-ZTEST(8) NAME yaz-ztest - Z39.50 Test Server SYNOPSIS application [-install] [-installa] [-remove] [-a _f_i_l_e] [-v _l_e_v_e_l] [-l _f_i_l_e] [-u _u_i_d] [-c _c_o_n_f_i_g] [-f _v_c_o_n_f_i_g] [-C _f_n_a_m_e] [-t _m_i_n_u_t_e_s] [-k _k_i_l_o_b_y_t_e_s] [-d _d_a_e_m_o_n] [-w _d_i_r] [-p _p_i_d_f_i_l_e] [-r _k_i_l_o_b_y_t_e_s] [-ziDST1] [listener-spec...] DESCRIPTION yaz-ztest is a Z39.50 test server that uses the YAZ generic frontend server API. The server acts as a real Z39.50 server but does not use a database. It returns a random hit count and returns a subset of a few built-in records. The _l_i_s_t_e_n_e_r-_s_p_e_c consists of a transport mode followed by a colon, followed by a listener address. The transport mode is either tcp, unix, or ssl. For TCP and SSL, an address has the form: hostname | IP-number [ : portnumber ] For UNIX local socket the address is the filename of the local socket. OPTIONS -a _f_i_l_e Specify a file for dumping PDUs (for diagnostic purposes). The special name - (dash) sends output to stderr. -S Don't fork or make threads on connection requests. This is good for debugging, but not recommended for real operation: Although the server is asynchronous and non-blocking, it can be nice to keep a software malfunction (okay then, a crash) from affecting all current users. -1 Like -S but after one session the server exits. This mode is for debugging _o_n_l_y. -T Operate the server in threaded mode. The server creates a thread for each connection rather than a fork a process. Only available on UNIX systems that offers POSIX threads. YAZ 3.0.46 Last change: 06/08/2009 1 Maintenance Procedures YAZ-ZTEST(8) -s Use the SR protocol (obsolete). -z Use the Z39.50 protocol (default). This option and -s complement each other. You can use both multiple times on the same command line, between listener-specifications (see below). This way, you can set up the server to listen for connections in both protocols concurrently, on different local ports. -l _f_i_l_e The logfile. -c _c_o_n_f_i_g A user option that serves as a specifier for some sort of configuration, usually a filename. The argument to this option is transferred to member configname of the statserv_options_block. -f _v_c_o_n_f_i_g This specifies an XML file that describes one or more YAZ frontend virtual servers. -C _f_n_a_m_e Sets SSL certificate file name for server (PEM). -v _l_e_v_e_l The log level. Use a comma-separated list of members of the set {fatal,debug,warn,log,malloc,all,none}. -u _u_i_d Set user ID. Sets the real UID of the server process to that of the given user. It's useful if you aren't comfortable with having the server run as root, but you need to start it as such to bind a privileged port. -w _d_i_r The server changes to this directory during before listening on incoming connections. This option is useful when the server is operating from the inetd daemon (see -i). -p _p_i_d_f_i_l_e Specifies that the server should write its Process ID to file given by _p_i_d_f_i_l_e. A typical location would be /_v_a_r/_r_u_n/_y_a_z-_z_t_e_s_t._p_i_d. -i Use this to make the the server run from the inetd server (UNIX only). YAZ 3.0.46 Last change: 06/08/2009 2 Maintenance Procedures YAZ-ZTEST(8) -D Use this to make the server put itself in the background and run as a daemon. If neither -i nor -D is given, the server starts in the foreground. -install Use this to install the server as an NT service (Windows NT/2000/XP only). Control the server by going to the Services in the Control Panel. -installa Use this to install and activate the server as an NT service (Windows NT/2000/XP only). Control the server by going to the Services in the Control Panel. -remove Use this to remove the server from the NT services (Windows NT/2000/XP only). -t _m_i_n_u_t_e_s Idle session timeout, in minutes. -k _s_i_z_e Maximum record size/message size, in kilobytes. -r _s_i_z_e Maximum size of log file before rotation occurs, in kilobytes. Default size is 1048576 k (=1 GB). -d _d_a_e_m_o_n Set name of daemon to be used in hosts access file. See hosts_access(5) and tcpd(8). -m _t_i_m_e-_f_o_r_m_a_t Sets the format of time-stamps in the log-file. Specify a string in the input format to strftime(). GFS CONFIGURATION AND VIRTUAL HOSTS The Virtual hosts mechanism allows a YAZ frontend server to support multiple backends. A backend is selected on the basis of the TCP/IP binding (port+listening adddress) and/or the virtual host. A backend can be configured to execute in a particular working directory. Or the YAZ frontend may perform CQL to RPN conversion, thus allowing traditional Z39.50 backends to be offered as a SRW/SRU service. SRW/SRU Explain information for a particular backend may also be specified. For the HTTP protocol, the virtual host is specified in the Host header. For the Z39.50 protocol, the virtual host is specified as in the Initialize Request in the OtherInfo, OID YAZ 3.0.46 Last change: 06/08/2009 3 Maintenance Procedures YAZ-ZTEST(8) 1.2.840.10003.10.1000.81.1. Note Not all Z39.50 clients allows the VHOST information to be set. For those the selection of the backend must rely on the TCP/IP information alone (port and address). The YAZ frontend server uses XML to describe the backend configurations. Command-line option -f specifies filename of the XML configuration. The configuration uses the root element yazgfs. This element includes a list of listen elements, followed by one or more server elements. The listen describes listener (transport end point), such as TCP/IP, Unix file socket or SSL server. Content for a listener: CDATA (required) The CDATA for the listen element holds the listener string, such as tcp:@:210, tcp:server1:2100, etc. attribute id (optional) identifier for this listener. This may be referred to from server sections. Note We expect more information to be added for the listen section in a future version, such as CERT file for SSL servers. The server describes a server and the parameters for this server type. Content for a server: attribute id (optional) Identifier for this server. Currently not used for anything, but it might be for logging purposes. attribute listenref (optional) Specifies listener for this server. If this attribute is not given, the server is accessible from all listener. In order for the server to be used for real, howeever, the virtual host must match (if specified in the configuration). element config (optional) Specifies the server configuration. This is equivalent to the config specified using command line option -c. YAZ 3.0.46 Last change: 06/08/2009 4 Maintenance Procedures YAZ-ZTEST(8) element directory (optional) Specifies a working directory for this backend server. If specifid, the YAZ fronend changes current working directory to this directory whenever a backend of this type is started (backend handler bend_start), stopped (backend handler hand_stop) and initialized (bend_init). element host (optional) Specifies the virtual host for this server. If this is specified a client _m_u_s_t specify this host string in order to use this backend. element cql2rpn (optional) Specifies a filename that includes CQL to RPN conversion for this backend server. See ??? If given, the backend server will only "see" a Type-1/RPN query. element ccl2rpn (optional) Specifies a filename that includes CCL to RPN conversion for this backend server. See ??? If given, the backend server will only "see" a Type-1/RPN query. element stylesheet (optional) Specifies the stylesheet reference to be part of SRU HTTP responses when the client does not specify one. If neither this is given, nor the client specifies one, no stylesheet reference is part of the SRU HTTP response. element docpath (optional) Specifies a path for local file access using HTTP. All URLs with a leading prefix (/ exluded) that matches the value of docpath are used for file access. For example, if the server is to offer access in directory xsl, the docpath would be xsl and all URLs of the form http://host/exl will result in a local file access. element explain (optional) Specifies SRW/SRU ZeeRex content for this server. Copied verbatim to the client. As things are now, some of the Explain content seeem redundant because host information, etc. is also stored elsewhere. element maximumrecordsize (optional) Specifies maximum record size/message size, in bytes. This value also servers as maximum size of _i_n_c_o_m_i_n_g packages (for Record Updates etc). It's the same value as that given by the -k option. element retrievalinfo (optional) Enables the retrieval facility supporting conversions and specifications of record formats/types. See ??? for more information. YAZ 3.0.46 Last change: 06/08/2009 5 Maintenance Procedures YAZ-ZTEST(8) The XML below configures a server that accepts connections from two ports, TCP/IP port 9900 and a local UNIX file socket. We name the TCP/IP server public and the other server internal. tcp:@:9900 unix:/var/tmp/socket server1.mydomain /var/www/s1 config.cfg server2.mydomain /var/www/s2 config.cfg ../etc/pqf.properties server2.mydomain 9900 a /var/www/s3 config.cfg There are three configured backend servers. The first two servers, "server1" and "server2", can be reached by both listener addresses - since no listenref attribute is specified. In order to distinguish between the two a virtual host has been specified for each of server in the host elements. For "server2" elements for CQL to RPN conversion is supported and explain information has been added (a short one here to keep the example small). The third server, "server3" can only be reached via listener "internal". FILES _y_a_z-<_v_e_r_s_i_o_n>/_z_t_e_s_t/_y_a_z-_z_t_e_s_t._c YAZ 3.0.46 Last change: 06/08/2009 6 Maintenance Procedures YAZ-ZTEST(8) _y_a_z-<_v_e_r_s_i_o_n>/_i_n_c_l_u_d_e/_y_a_z/_b_a_c_k_e_n_d._h SEE ALSO yaz(7) yaz-log(7) ATTRIBUTES See attributes(5) for descriptions of the following attributes: _______________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE| |_________________________________________|____________________________________|_ | Availability | SUNWlibyaz | |_________________________________________|____________________________________|_ | Interface Stability| Uncommitted | |_____________________|__________________| NOTES Source for YAZ is available on http://opensolaris.org. YAZ 3.0.46 Last change: 06/08/2009 7