Facility to change working directory for daemon
[pazpar2-moved-to-github.git] / doc / pazpar2.xml
1 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.4//EN"
2  "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
3 [
4      <!ENTITY % local SYSTEM "local.ent">
5      %local;
6      <!ENTITY % entities SYSTEM "entities.ent">
7      %entities;
8      <!ENTITY % idcommon SYSTEM "common/common.ent">
9      %idcommon;
10 ]>
11 <refentry id="pazpar2">
12  <refentryinfo>
13   <productname>Pazpar2</productname>
14   <productnumber>&version;</productnumber>
15   <info><orgname>Index Data</orgname></info>
16  </refentryinfo>
17
18  <refmeta>
19   <refentrytitle>Pazpar2</refentrytitle>
20   <manvolnum>8</manvolnum>
21   <refmiscinfo class="manual">System management commands</refmiscinfo>
22  </refmeta>
23  
24  <refnamediv>
25   <refname>pazpar2</refname>
26   <refpurpose>Metasearch daemon.</refpurpose>
27  </refnamediv>
28  
29  <refsynopsisdiv>
30   <cmdsynopsis>
31    <command>pazpar2</command>
32    <arg choice="opt"><option>-d</option></arg>
33    <arg choice="opt"><option>-D</option></arg>
34    <arg choice="opt"><option>-f <replaceable>config</replaceable></option></arg>
35    <arg choice="opt"><option>-h <replaceable>ip:port</replaceable></option></arg>
36    <arg choice="opt"><option>-l <replaceable>logfile</replaceable></option></arg>
37    <arg choice="opt"><option>-p <replaceable>pidfile</replaceable></option></arg>
38    <arg choice="opt"><option>-R <replaceable>recfile</replaceable></option></arg>
39    <arg choice="opt"><option>-t</option></arg>
40    <arg choice="opt"><option>-u <replaceable>uid</replaceable></option></arg>
41    <arg choice="opt"><option>-v <replaceable>level</replaceable></option></arg>
42    <arg choice="opt"><option>-V</option></arg>
43    <arg choice="opt"><option>-w <replaceable>dir</replaceable></option></arg>
44    <arg choice="opt"><option>-X</option></arg>
45    <arg choice="opt"><option>-install</option></arg>
46    <arg choice="opt"><option>-remove</option></arg>
47   </cmdsynopsis>
48  </refsynopsisdiv>
49  
50  <refsect1>
51   <title>DESCRIPTION</title>
52   <para>
53    <command>pazpar2</command> is the Pazpar2 Metasearch daemon
54    and server.
55    In normal operation it acts as a simple HTTP server which serves
56    the Pazpar2 protocol.
57    The HTTP listener address may be given on the command line using
58    option <option>-h</option> or in the main configuration
59    file. The main configuration must be specified using option
60    <option>-f</option>.
61   </para>
62  </refsect1>
63  
64  <refsect1>
65   <title>OPTIONS</title>
66   
67   <variablelist>
68    <varlistentry>
69     <term><option>-d</option></term>
70     <listitem>
71      <para>
72       Enables dump of XML records to the current log file.
73       It is useful if stylesheets are being debugged.
74      </para>
75      <para>
76       This option may also be used together with option <option>-t</option>
77       in which case the configuration, after include processing, will be
78       dumped to stdout.
79      </para>
80     </listitem>
81    </varlistentry>
82    <varlistentry>
83     <term><option>-D</option></term>
84     <listitem>
85      <para>
86      Puts the Pazpar2 server in the background.
87      </para>
88     </listitem>
89    </varlistentry>
90    <varlistentry>
91     <term><option>-f <replaceable>config</replaceable></option></term>
92     <listitem>
93      <para>
94       Specifies main configuration. This option must be specified
95       in order for Pazpar2 to operate normally.
96      </para>
97     </listitem>
98    </varlistentry>
99    <varlistentry>
100     <term><option>-h <replaceable>ip:port</replaceable></option></term>
101     <listitem>
102      <para>
103       Specifies the HTTP listener binding address.
104       The <replaceable>ip</replaceable>
105       may be a hostname or <literal>@</literal> for "any" address.
106       The <replaceable>port</replaceable> is an integer.
107      </para>
108     </listitem>
109    </varlistentry>
110    <varlistentry>
111     <term><option>-l <replaceable>logfile</replaceable></option></term>
112     <listitem>
113      <para>
114       Specifies log file. The log file must be specified when Pazpar2
115       is running in the background (-D).
116      </para>
117     </listitem>
118    </varlistentry>
119    <varlistentry>
120     <term><option>-p <replaceable>pidfile</replaceable></option></term>
121     <listitem>
122      <para>
123       Specifies PID file. If Pazpar2 is started and configured properly
124       the file given holds the process ID of the Pazpar2 process.
125      </para>
126     </listitem>
127    </varlistentry>
128    <varlistentry>
129     <term><option>-R <replaceable>recfile</replaceable></option></term>
130     <listitem>
131      <para>
132       If this option is given, HTTP requests are logged to file named
133       <replaceable>recfile</replaceable>.
134      </para>
135     </listitem>
136    </varlistentry>
137
138    <varlistentry>
139     <term><option>-t</option></term>
140     <listitem>
141      <para>
142       Checks parameters and configuration. No service or daemon is
143       started. Useful for checking a new configuration before a
144       Pazpar2 is restarted.
145      </para>
146      <para>
147       The configuration, after include processing, may also be dumped
148       to stdout by supplying option <option>-d</option> as well.
149      </para>
150      <note>
151       <para>
152        In Pazpar2 1.2 and earlier releases, option -t specified a
153        local target settings file.
154       </para>
155      </note>
156     </listitem>
157    </varlistentry>
158
159    <varlistentry>
160     <term><option>-u <replaceable>uid</replaceable></option></term>
161     <listitem>
162      <para>
163       Makes the Pazpar2 server change user ID to the
164       <replaceable>uid</replaceable> given.
165       This, normally, requires root privilege.
166      </para>
167     </listitem>
168    </varlistentry>
169
170    <varlistentry>
171     <term><option>-v <replaceable>level</replaceable></option></term>
172     <listitem>
173      <para>
174       Sets log level (YAZ log level system).
175      </para>
176     </listitem>
177    </varlistentry>
178
179    <varlistentry>
180     <term><option>-V</option></term>
181     <listitem>
182      <para>
183       Shows Pazpar2 version and versions of some of the components that it
184       is using (ICU and YAZ). Pazpar2 will exit immediately after
185       displaying the version information (no daemon started).
186      </para>
187     </listitem>
188    </varlistentry>
189
190    <varlistentry>
191     <term><option>-w <replaceable>dir</replaceable></option></term>
192     <listitem>
193      <para>
194       Changes working directory to <replaceable>dir</replaceable>.
195      </para>
196     </listitem>
197    </varlistentry>
198
199    <varlistentry>
200     <term><option>-X</option></term>
201     <listitem>
202      <para>
203       Makes the Pazpar2 server operate in debugging mode.
204       This prevents Pazpar2 from making separate threads and processes.
205       This option should not be used in production.
206      </para>
207     </listitem>
208    </varlistentry>
209
210    <varlistentry>
211     <term><option>-install</option></term>
212     <listitem>
213      <para>
214       This is an option which is only recognized on Windows. It installs
215       Pazpar2 as a Windows Service.
216      </para>
217      <note>
218       <para>
219        Pazpar2 only supports Windows Service options if Pazpar2 is
220        linked against YAZ 3.0.29 or later.
221       </para>
222      </note>
223     </listitem>
224    </varlistentry>
225
226    <varlistentry>
227     <term><option>-remove</option></term>
228     <listitem>
229      <para>
230       This is an option which is only recognized on Windows. It removes
231       a Pazpar2 - Windows Service.
232      </para>
233     </listitem>
234    </varlistentry>
235
236   </variablelist>
237   
238  </refsect1>
239  
240  <refsect1>
241   <title>EXAMPLES</title>
242   <para>The Debian package of pazpar2 starts the server with:
243    <screen>
244     pazpar2 -D -f /etc/pazpar2/pazpar2.cfg -l /var/log/pazpar2.log -p /var/run/pazpar2.pid -u nobody
245    </screen>
246    (one line). 
247   </para>
248   <para>
249    This will put pazpar2 in the background (-D), read config from from
250    <filename>/etc/pazpar2/pazpar2.cfg</filename>, log messages to
251    <filename>/var/log/pazpar2.log</filename>, create PID file
252    <filename>/var/run/pazpar2.pid</filename>. When the daemon is properly
253    started, the server will change effective user ID to nobody.
254   </para>
255   <para>
256    The server can be terminated with:
257    <screen>
258     kill `cat /var/run/pazpar2.pid`
259    </screen>
260   </para>
261   <para>
262    If Pazpar2 is to be debugged using GDB, we use option -X:
263    <screen>
264     cd pazpar2/src
265     gdb ./pazpar2
266     (gdb) run -X -f ../etc/pazpar2.cfg
267    </screen>
268   </para>
269  </refsect1> 
270  
271  <refsect1>
272   <title>FILES</title>
273   <para><filename>/usr/sbin/pazpar2</filename>: pazpar2 daemon</para>
274   
275   <para><filename>/usr/share/pazpar2</filename>: pazpar2 shared files</para>
276   
277   <para><filename>/etc/pazpar2</filename>: pazpar2 config area</para>
278  </refsect1>
279  
280  <refsect1>
281   <title>SEE ALSO</title>
282   <para>
283    Pazpar2 configuration:
284    <citerefentry>
285     <refentrytitle>pazpar2_conf</refentrytitle>
286     <manvolnum>5</manvolnum>
287    </citerefentry>
288   </para>
289   <para>
290    Pazpar2 protocol:
291    <citerefentry>
292     <refentrytitle>pazpar2_protocol</refentrytitle>
293     <manvolnum>7</manvolnum>
294    </citerefentry>
295   </para>
296  </refsect1>
297
298 </refentry>
299
300 <!-- Keep this comment at the end of the file
301 Local variables:
302 mode: nxml
303 nxml-child-indent: 1
304 End:
305 -->