~ubuntu-branches/ubuntu/oneiric/pyro/oneiric

« back to all changes in this revision

Viewing changes to docs/3-install.html

  • Committer: Bazaar Package Importer
  • Author(s): Bernd Zeimetz
  • Date: 2007-09-01 23:12:52 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20070901231252-veufo1dqva5oipo1
Tags: 3.7-1
* Adopting the package in the name of the Python Modules Team
  (Closes: #439048)
  - Thanks to Alexandre Fayolle and Jérémy Bobbio for the previous NMUs
    (Closes: #216731, #377680, #391808)
* New upstream version
* debian/watch:
  - Adding file
* debian/control:
  - Reflecting maintainer change
  - Adding XS-Vcs-Svn and XS-Vcs-Browser fields
  - Moving python to Build-Depends because it's used in the clean target
  - Adding dpatch to Build-Depends
  - Putting pyro-doc into the doc Section
* debian/semantic.cache:
  - Removing file, not needed for packaging pyro
* debian/setup.cfg:
  - Adding file to configure upstream's very special setup.py
* debian/rules:
  - Fixing build process to use debian/setup.cfg
  - Adding dpatch targets/include
* debian/README.Debian:
  - Removing file, explanation not needed anymore
* debian/NEWS.Debian:
  - Adding file, explaining upstream's change in the script names
* debian/patches:
  - Adding patch to cleanup/fix shebangs

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
2
<html>
3
 
<!-- $Id: 3-install.html,v 2.30 2004/05/27 23:03:04 irmen Exp $ -->
 
3
<!-- $Id: 3-install.html,v 2.44 2007/03/07 23:08:19 irmen Exp $ -->
4
4
<head>
5
 
   <title>PYRO - Installation</title>
 
5
  <title>PYRO - Installation</title>
 
6
  <link rel="stylesheet" type="text/css" href="pyromanual_print.css" media="print">
 
7
  <link rel="stylesheet" type="text/css" href="pyromanual.css" media="screen">
6
8
</head>
7
 
<body background="backdrop.jpg">
8
 
<table border="0" width="100%">
9
 
<tr>
10
 
<td align="left"><a href="2-concepts.html">&lt;previous</a> | <a href="PyroManual.html">contents</a> | <a href="4-usage.html">next&gt;</a>
11
 
<td align="right">Pyro Manual
12
 
</tr>
13
 
</table>
14
 
<hr>
15
 
 
16
 
 
17
 
<h2><u>3. Installation and Configuration</u></h2>
18
 
Please read this entire chapter before trying to install Pyro.&nbsp; Not
19
 
that it's complex, but just that you've seen the choices you have to make.
20
 
<p><strong>Installation</strong><p>
21
 
Pyro distributions contain a &quot;distutils&quot; <code>setup.py</code> script
22
 
that will install Pyro for you; just enter the following command from a shell prompt: 
23
 
&quot;<code>python setup.py install</code>&quot; and off you go.
24
 
The script will ask if you want to install the Pyro script tools, and where to put them.
25
 
If you want to do an automated (unattended) install, edit the <code>setup.cfg</code> file,
26
 
following the directions in that file.
27
 
<em>It will not install the documentation and the examples, only the core Pyro library and the scripts.</em>
28
 
<p>But I will explain what exactly is in the Pyro distribution. It has a few subdirectories:
29
 
<dl>
30
 
<dt><code>Pyro/</code></dt>
31
 
<dd> This is the actual Pyro package. If you do not use the supplied <code>setup.py</code>
32
 
install script (see above) you have to install it by hand.
33
 
Install this directory somewhere in your Python search path. On most systems (also Windows),
34
 
the <code>lib/site-packages</code> directory is a nice place. The exact location might
35
 
vary according to your specific Python installation.
36
 
<dd> Alternatively, keep it where it is and manually add the Pyro root directory
37
 
to your Python search path (e.g. in the environment variable <code>PYTHONPATH</code>).</dd>
38
 
<dt><code>bin/</code></dt>
39
 
<dd> This directory contains the command-line utilities. Move the contents of this directory somewhere in your shell search path.</dd>
40
 
<dd> Alternatively, keep it where it is and manually add it to your shell search
41
 
path.</dd>
42
 
<dt><code>docs/</code>&nbsp;&nbsp; and&nbsp;&nbsp; <code>examples/</code></dt>
43
 
<dd>Put those wherever you like. In docs you can find the Pyro manual, and in examples there are some Pyro examples.</dd>
44
 
</dl>
45
 
 
46
 
<p><strong>Configuration</strong><p>
47
 
The default settings will do nicely in most cases. But sooner or later you will have to change some parameters of Pyro. 
48
 
Pyro's configuration is accessed through <code>Pyro.config</code>. This object has several configuration items:<br>
49
 
<table border=1>
50
 
<tr><th>Configuration item<th>Type<th>Description<th>Default value
51
 
<tr><td><code>PYRO_CONFIG_FILE</code>
52
 
<td>string
53
 
<td>The Pyro configuration file that is used. See below.
54
 
<td>Special, see below</tr>
55
 
<tr><td><code>PYRO_STORAGE</code>
56
 
<td>string
57
 
<td>Location where Pyro stores data like log files. <em>Read the notice at the end!</em>
58
 
<td><i>Current directory</i></tr>
59
 
<tr><td><code>PYRO_LOGFILE</code>
60
 
<td>string
61
 
<td>Name of the logfile. If it's not an absolute path, it's relative to <code>$PYRO_STORAGE</code>. It's best to modify this <em>before</em> importing <code>Pyro.util</code>!
62
 
<td><code>Pyro_log</code></tr>
63
 
<tr><td><code>PYRO_USER_LOGFILE</code>
64
 
<td>string
65
 
<td>Name of the user logfile. If it's not an absolute path, it's relative to <code>$PYRO_STORAGE</code>.
66
 
<td><code>Pyro_userlog</code></tr>
67
 
<tr><td><code>PYRO_TRACELEVEL</code>
68
 
<td>number
69
 
<td>The tracing level of Pyro, 0-3. 0=nothing, 1=only errors, 2=warnings too, 3=full: errors, warnings and notes.
70
 
<td>0</tr> 
71
 
<tr><td><code>PYRO_USER_TRACELEVEL</code>
72
 
<td>number
73
 
<td>The user tracing level, 0-3. 0=nothing, 1=only errors, 2=warnings too, 3=full: errors, warnings and notes.
74
 
<td>0</tr>              
75
 
<tr><td><code>PYRO_DETAILED_TRACEBACK</code>
76
 
<td>boolean
77
 
<td>Should Pyro dump detailed tracebacks (with dumps of local variable's values)? If set to 1 on the server, the clients will get
78
 
detailed tracebacks from inside the server's code. You may not want this (security)...
79
 
<td>0</tr>              
80
 
<tr><td><code>PYRO_PRINT_REMOTE_TRACEBACK</code>
81
 
<td>boolean
82
 
<td>Should Pyro print remote traceback information inside exception tracebacks?
83
 
<td>0</tr>              
84
 
<tr><td><code>PYRO_STDLOGGING</code>
85
 
<td>boolean
86
 
<td>Should Pyro use new-style logging using the <code>logging</code> module (Python 2.3+)?
87
 
<td>0</tr>              
88
 
<tr><td><code>PYRO_STDLOGGING_CFGFILE</code>
89
 
<td>string
90
 
<td>Name of the configuration file that is used to configure the new-style logging. If it's not an absolute path, it's relative to <code>$PYRO_STORAGE</code>.
91
 
If this file doesn't exist, Pyro uses the default configuration that resembles the classic Pyro logging style.
92
 
<td><code>logging.cfg</code></tr>              
93
 
<tr><td><code>PYRO_PICKLE_FORMAT</code>
94
 
<td>integer
95
 
<td>The pickle protocol format that Pyro will use for marshaling.
96
 
<td><code>pickle.HIGHEST_PROTOCOL</code> on Python 2.3+, else 1</tr>
97
 
<tr><td><code>PYRO_XML_PICKLE</code>
98
 
<td>string
99
 
<td>Whether the marshaling is done using the safe xml pickling (from Gnosis_utils or PyXML) or the default pickle.
100
 
        The xml_pickle is not vulnerable for the <a href="9-security.html#pickle">pickle trojan problem</a>, but it is an 
101
 
order of a magnitude slower, and requires more bandwith.
102
 
Use &quot;any&quot; for any implementation (defaults to PyXML), &quot;pyxml&quot; for PyXML, &quot;gnosis&quot; for Gnosis.
103
 
PyXML seems to be about three to four times faster than Gnosis, this
104
 
could be because PyXML uses extension modules built in C.
105
 
You need to have installed <a href="http://gnosis.cx/download/">Gnosis_Utils</a> (at least version 1.0.2, latest is 1.1.0 at the time of writing).
106
 
For <a href="http://sourceforge.net/project/showfiles.php?group_id=6473">PyXML</a>, you need at least version 0.8, latest is 0.8.3 at the time of writing.
107
 
<td><i>empty</i> (disabled)</tr>
108
 
<tr><td><code>PYRO_COMPRESSION</code>
109
 
<td>boolean
110
 
<td>Whether the protocol should compress the data to save bandwidth (at the cost of CPU time).
111
 
The <code>zlib</code> module is used for compression. If you don't have <code>zlib</code>, Pyro still works, but without compression.
112
 
<td>0</tr>
113
 
<tr><td><code>PYRO_CHECKSUM</code>
114
 
<td>boolean
115
 
<td>Whether the protocol should perform a checksum over the message data. This costs a little bit extra CPU time, but you
116
 
will be quite sure that your communication is without errors.
117
 
The <code>zlib.adler32</code> function is used for checksumming. If you don't have <code>zlib</code>, Pyro still works, but without checksumming.
118
 
The overhead of checksumming is very small, with regular messages less than 0.1%, but
119
 
increasing with big messages (15% for 5 Mb or so).
120
 
<strong>Note:</strong> the checksum is by no means secure. If you want secure transmissions,
121
 
you'll have to use SSL or build your own encryption/secure hashing functions on top of Pyro.
122
 
<td>0</tr>
123
 
<tr><td><code>PYRO_SOCK_KEEPALIVE</code>
124
 
<td>boolean
125
 
        <td>Whether Pyro should set the SO_KEEPALIVE socket option on the network sockets. This is used to detect broken client connections, to let the Pyro server clean them up nicely. It is enabled by default, but it could cause problems in certain situations so you can turn it off if you want.
126
 
                The timeout period is system-dependent but usually around 2 hours. It depends on your OS how to change this value, but have a look at &quot;sysctl&quot;. (This feature may not be available on all
127
 
                OS's, if your OS doesn't support it, Pyro will automatically switch it off).
128
 
<td>1</tr>
129
 
<tr><td><code>PYRO_MAXCONNECTIONS</code>
130
 
<td>number
131
 
<td>The maximum number of simultaneous connections to one Pyro server. Note that a custom connection validator may or may not take this in account. The default validator does check for this limit.
132
 
<td>200</tr>
133
 
<tr><td><code>PYRO_TCP_LISTEN_BACKLOG</code>
134
 
<td>number
135
 
<td>The size of the TCP socket listen backlog for Pyro daemons.
136
 
<td>200</tr>
137
 
<tr><td><code>PYRO_MULTITHREADED</code>
138
 
<td>boolean
139
 
<td>Whether Pyro servers should be multithreaded or not.
140
 
<td>1 (if supported)</tr>
141
 
<tr><td><code>PYRO_MOBILE_CODE</code>
142
 
<td>boolean
143
 
<td>On the server: whether Pyro should automatically download Python code from clients if
144
 
it isn't available on the server. On the client: whether Pyro should automatically download Python code from the
145
 
server if it returns objects that aren't available on the client.
146
 
<td>0</tr>
147
 
<tr><td><code>PYRO_DNS_URI</code>
148
 
<td>boolean
149
 
<td>Whether symbolic DNS host names should be used in URIs instead of fixed IP addresses.
150
 
<td>0</tr>
151
 
<tr><td><code>PYRO_BC_RETRIES</code>
152
 
<td>number
153
 
<td>How often a broadcast will be retried if no answer has been received. Currently only used by the Name Server locator.
154
 
<td>2</tr>
155
 
<tr><td><code>PYRO_BC_TIMEOUT</code>
156
 
<td>number
157
 
<td>How long Pyro will wait (in seconds) for an answer to a broadcast request. Currently only used by the Name Server locator.
158
 
<td>2</tr>
159
 
<tr><td><code>PYRO_PORT</code>
160
 
<td>number
161
 
<td>The base socket number of the range of socket numbers that the Pyro daemon can use to listen for incoming requests (Pyro method calls).
162
 
<td>7766</tr>
163
 
<tr><td><code>PYRO_PORT_RANGE</code>
164
 
<td>number
165
 
<td>The size of the socket port range. Pyro will try to claim a socket for its Deamons in the socket port range PYRO_PORT to (but not including) PYRO_PORT+PYRO_PORT_RANGE.
166
 
This means that if Pyro already has a Daemon listning on socket N, a new Deamon will claim socket N+1, and so on. You can disable
167
 
this by using a special argument when construction a Daemon (or setting this item to 1).
168
 
<td>100</tr>
169
 
<tr><td><code>PYRO_NS_DEFAULTGROUP</code>
170
 
<td>string
171
 
<td>The default group name in which names are located. <em>This must be an absolute name (starting with the root character).</em>
172
 
<td><code>:Default</code>
173
 
<tr><td><code>PYRO_NS_URIFILE</code>
174
 
<td>string
175
 
<td>The file where the Name Server will write its URI. If it's not an absolute path, it's relative to <code>$PYRO_STORAGE</code>.
176
 
<td><code>Pyro_NS_URI</code>
177
 
<tr><td><code>PYRO_NS_HOSTNAME</code>
178
 
<td>string
179
 
<td>The hostname that is tried to find the NameServer on, when the broadcast lookup mechanism fails.
180
 
<td><i>empty</i></tr>
181
 
<tr><td><code>PYRO_NS_PORT</code>
182
 
<td>number
183
 
<td>The socket number on which the Name Server will listen for incoming requests (Pyro method calls, in fact).
184
 
<td>9090</tr>
185
 
<tr><td><code>PYRO_NS_BC_PORT</code>
186
 
<td>number
187
 
<td>The socket number on which the Name Server will listen for broadcast requests (usually to find the location).
188
 
<td>9090</tr>
189
 
<tr><td><code>PYRO_NS2_HOSTNAME</code>
190
 
<td>string
191
 
<td>Like above, but for the second (paired) Name Server.
192
 
<td><i>empty</i></tr>
193
 
<tr><td><code>PYRO_NS2_PORT</code>
194
 
<td>number
195
 
<td>Like above, but for the second (paired) Name Server.
196
 
<td>9091</tr>
197
 
<tr><td><code>PYRO_NS2_BC_PORT</code>
198
 
<td>number
199
 
<td>Like above, but for the second (paired) Name Server.
200
 
<td>9091</tr>
201
 
<tr><td><code>PYRO_ES_QUEUESIZE</code>
202
 
<td>number
203
 
<td>The size of the message queues per subscriber that the Event Server allocates. Use 0 (zero) for infinite size.
204
 
<td>1000</tr>
205
 
<tr><td><code>PYRO_ES_BLOCKQUEUE</code>
206
 
<td>boolean
207
 
        <td>If true (1), a publisher will block if an event queue on the server is full, 
208
 
                and continue as soon as the queue has some space again. If false (0), 
209
 
                the publisher won't block, but <em>the event is lost</em>.
210
 
<td>1</tr>
211
 
<tr><td><code>PYROSSL_CERTDIR</code>
212
 
<td>string
213
 
<td>The directory where openssl certificates are stored.
214
 
<td>'certs' in the PYRO_STORAGE location.</tr>
215
 
<tr><td><code>PYROSSL_CA_CERT</code>
216
 
<td>string
217
 
<td>Certificate of the Certificate Authority.  Used to check if client and server certificates are valid (that they are signed by the given CA)
218
 
<td>ca.pem</tr>
219
 
<tr><td><code>PYROSSL_SERVER_CERT</code>
220
 
<td>string
221
 
<td>Certificate for server side
222
 
<td>server.pem</tr>
223
 
<tr><td><code>PYROSSL_CLIENT_CERT</code>
224
 
<td>string
225
 
<td>Certificate for client side
226
 
<td>client.pem</tr>
227
 
</table>
228
 
<p>
229
 
There are several ways to change the default settings:
230
 
<ol>
231
 
<li>Change the settings in your code, at runtime. You can change all settings before starting Pyro, and most settings can be changed dynamically during execution too.
232
 
<em>Note that you cannot use this to change <code>Pyro.config.PYRO_STORAGE</code>! See below!</em>
233
 
<br>...<code> Pyro.config.PYRO_PORT = 7000</code><br>
234
 
...<code> Pyro.config.PYRO_TRACELEVEL = 3</code>
235
 
<li>Define environment variables that override the default settings.
236
 
<br>Every configuration item has an equivalent environment variable. If you define this, you can override the default setting for that item. For instance, it might be convenient to have your Pyro programs generate log files and put them in a designated log directory:<br>
237
 
...<code>$ export PYRO_LOGFILE=/var/log/PYRO/logfile</code><br>
238
 
...<code>$ export PYRO_TRACELEVEL=3</code><br>
239
 
(This is for bash - syntax is different for other shells or Windows.)
240
 
<li>Configuration files 
241
 
<br>You can use a configuration file that can contain some small configuration changes or a fully new configuration for all items.
242
 
Pyro checks if the environment variable <code>PYRO_CONFIG_FILE</code> is set. If it isn't set, or set to an empty string, Pyro checks for a <code>Pyro.conf</code> file in the current directory.
243
 
If it exists, Pyro uses it as a configuration file. If it doesn't exist, Pyro uses the default built-in configuration.
244
 
<br>If the environment variable is set, Pyro uses the value as the name for the configuration file. If the configuration file can't be read, a PyroError exception occurs.
245
 
<p>
246
 
The format of the configuration file is very simple. It is a text file, and each line can be empty, a comment, or a configuration item setting.
247
 
A comment starts with '#'. A config item setting is of the format 'ITEM=VALUE'. If Pyro finds an unknown config item, a KeyError exception occurs.
248
 
<p>
249
 
Note that <code>PYRO_CONFIG_FILE</code> is useless inside a configuration file. After initialization, it is set to the absolute path of the configuration file that was used (or the empty string, if no configuration file was used).
250
 
Note that setting <code>PYRO_CONFIG_FILE</code> from within your code is useless too because Pyro is already initialized at that point.
251
 
</ol>
252
 
Environment variables override configuration file settings. Configuration file settings override the built-in default settings.
253
 
<p><code>PYRO_STORAGE</code> is used at initialization time, that is, as soon as a part of the Pyro package is imported in your program.
254
 
You can only change <code>PYRO_STORAGE</code> <em>beforehand</em> by either setting the
255
 
environment variable or making an entry in the configuration file. Changing <code>Pyro.config.PYRO_STORAGE</code>
256
 
in your program leads to unexpected results, because the initilization has already been done
257
 
using the old value. So don't do this, and use one of the two other ways.
258
 
<hr>
259
 
<table border="0" width="100%">
260
 
<tr>
261
 
<td align="left"><a href="2-concepts.html">&lt;previous</a> | <a href="PyroManual.html">contents</a> | <a href="4-usage.html">next&gt;</a>
262
 
<td align="right">Pyro Manual
263
 
</tr>
264
 
</table>
 
9
 
 
10
<body>
 
11
  <div class="nav">
 
12
  <table width="100%">
 
13
    <tr>
 
14
      <td align="left"><a href="2-concepts.html">&lt;previous</a> | <a href="PyroManual.html">contents</a> | <a href=
 
15
      "4-usage.html">next&gt;</a></td>
 
16
 
 
17
      <td align="right">Pyro Manual</td>
 
18
    </tr>
 
19
  </table>
 
20
<hr></div>
 
21
 
 
22
  <h2><u>3. Installation and Configuration</u></h2>Please read this entire chapter before trying to install Pyro.&nbsp;
 
23
  Not that it's complex, but just that you've seen the choices you have to make.
 
24
 
 
25
  <p><strong>Installation</strong></p>
 
26
 
 
27
  <p>Pyro distributions contain a &quot;distutils&quot; <code>setup.py</code> script that will install
 
28
      Pyro for you; just enter the following command from a shell prompt: &quot; <code>python setup.py
 
29
      install</code>&quot; and
 
30
      off you go. The script will ask if you want to install the Pyro script tools, and where to put
 
31
      them. If you want to do an automated (unattended) install, edit the <code>setup.cfg</code> file,
 
32
      following the directions in that file. <em>It will not install the
 
33
  documentation and the examples, only the core Pyro library and the scripts.</em></p>
 
34
 
 
35
  <p>But I will explain what exactly is in the Pyro distribution. It has a few subdirectories:</p>
 
36
 
 
37
  <dl>
 
38
    <dt><code>Pyro/</code></dt>
 
39
 
 
40
    <dd>This is the actual Pyro package. If you do not use the supplied <code>setup.py</code> install script (see
 
41
    above) you have to install it by hand. Install this directory somewhere in your Python search path. On most systems
 
42
    (also Windows), the <code>lib/site-packages</code> directory is a nice place. The exact location might vary
 
43
    according to your specific Python installation.</dd>
 
44
 
 
45
    <dd>Alternatively, keep it where it is and manually add the Pyro root directory to your Python search path (e.g. in
 
46
    the environment variable <code>PYTHONPATH</code>).</dd>
 
47
 
 
48
    <dt><code>bin/</code></dt>
 
49
 
 
50
    <dd>This directory contains the command-line utilities. Move the contents of this directory somewhere in your shell
 
51
    search path.</dd>
 
52
 
 
53
    <dd>Alternatively, keep it where it is and manually add it to your shell search path.</dd>
 
54
 
 
55
    <dt><code>docs/</code>&nbsp;&nbsp; and&nbsp;&nbsp; <code>examples/</code></dt>
 
56
 
 
57
    <dd>Put those wherever you like. In docs you can find the Pyro manual, and in examples there are some Pyro
 
58
    examples.</dd>
 
59
  </dl>
 
60
 
 
61
  <p><strong>Configuration</strong></p>
 
62
 
 
63
  <p>The default settings will do nicely in most cases. But sooner or later you will have to change some parameters of
 
64
  Pyro. Pyro's configuration is accessed through <code>Pyro.config</code>. This object has several configuration
 
65
  items:<br></p>
 
66
 
 
67
  <table>
 
68
    <tr>
 
69
      <th>Configuration item</th>
 
70
 
 
71
      <th>Type</th>
 
72
 
 
73
      <th>Description</th>
 
74
 
 
75
      <th>Default value</th>
 
76
    </tr>
 
77
 
 
78
    <tr>
 
79
      <td><code>PYRO_CONFIG_FILE</code></td>
 
80
 
 
81
      <td>string</td>
 
82
 
 
83
      <td>The Pyro configuration file that is used. See below.</td>
 
84
 
 
85
      <td>Special, see below</td>
 
86
    </tr>
 
87
 
 
88
    <tr>
 
89
      <td><code>PYRO_STORAGE</code></td>
 
90
 
 
91
      <td>string</td>
 
92
 
 
93
      <td>Location where Pyro stores data like log files. <em>Read the notice at the end!</em></td>
 
94
 
 
95
      <td><i>Current directory</i></td>
 
96
    </tr>
 
97
 
 
98
    <tr>
 
99
      <td><code>PYRO_LOGFILE</code></td>
 
100
 
 
101
      <td>string</td>
 
102
 
 
103
      <td>Name of the logfile. If it's not an absolute path, it's relative to <code>$PYRO_STORAGE</code>. It's best to
 
104
      modify this <em>before</em> importing <code>Pyro.util</code>!</td>
 
105
 
 
106
      <td><code>Pyro_log</code></td>
 
107
    </tr>
 
108
 
 
109
    <tr>
 
110
      <td><code>PYRO_USER_LOGFILE</code></td>
 
111
 
 
112
      <td>string</td>
 
113
 
 
114
      <td>Name of the user logfile. If it's not an absolute path, it's relative to <code>$PYRO_STORAGE</code>.</td>
 
115
 
 
116
      <td><code>Pyro_userlog</code></td>
 
117
    </tr>
 
118
 
 
119
    <tr>
 
120
      <td><code>PYRO_TRACELEVEL</code></td>
 
121
 
 
122
      <td>number</td>
 
123
 
 
124
      <td>The tracing level of Pyro, 0-3. 0=nothing, 1=only errors, 2=warnings too, 3=full: errors, warnings and
 
125
      notes.</td>
 
126
 
 
127
      <td>0</td>
 
128
    </tr>
 
129
 
 
130
    <tr>
 
131
      <td><code>PYRO_USER_TRACELEVEL</code></td>
 
132
 
 
133
      <td>number</td>
 
134
 
 
135
      <td>The user tracing level, 0-3. 0=nothing, 1=only errors, 2=warnings too, 3=full: errors, warnings and
 
136
      notes.</td>
 
137
 
 
138
      <td>0</td>
 
139
    </tr>
 
140
 
 
141
    <tr>
 
142
      <td><code>PYRO_DETAILED_TRACEBACK</code></td>
 
143
 
 
144
      <td>boolean</td>
 
145
 
 
146
      <td>Should Pyro dump detailed tracebacks (with dumps of local variable's values)? If set to 1 on the server, the
 
147
      clients will get detailed tracebacks from inside the server's code. You may not want this (security)...</td>
 
148
 
 
149
      <td>0</td>
 
150
    </tr>
 
151
 
 
152
    <tr>
 
153
      <td><code>PYRO_STDLOGGING</code></td>
 
154
 
 
155
      <td>boolean</td>
 
156
 
 
157
      <td>Should Pyro use new-style logging using the <code>logging</code> module (Python 2.3+)?</td>
 
158
 
 
159
      <td>0</td>
 
160
    </tr>
 
161
 
 
162
    <tr>
 
163
      <td><code>PYRO_STDLOGGING_CFGFILE</code></td>
 
164
 
 
165
      <td>string</td>
 
166
 
 
167
      <td>Name of the configuration file that is used to configure the new-style logging. If it's not an absolute path,
 
168
      it's relative to <code>$PYRO_STORAGE</code>. If this file doesn't exist, Pyro uses the default configuration that
 
169
      resembles the classic Pyro logging style.</td>
 
170
 
 
171
      <td><code>logging.cfg</code></td>
 
172
    </tr>
 
173
 
 
174
    <tr>
 
175
      <td><code>PYRO_PICKLE_FORMAT</code></td>
 
176
 
 
177
      <td>integer</td>
 
178
 
 
179
      <td>The pickle protocol format that Pyro will use for marshaling.</td>
 
180
 
 
181
      <td><code>pickle.HIGHEST_PROTOCOL</code> on Python 2.3+, else 1</td>
 
182
    </tr>
 
183
 
 
184
    <tr>
 
185
      <td><code>PYRO_XML_PICKLE</code></td>
 
186
 
 
187
      <td>string</td>
 
188
 
 
189
      <td>Whether the marshaling is done using the safe xml pickling or
 
190
          the default pickle. The xml_pickle is not vulnerable for the <a href="9-security.html#pickle">pickle
 
191
          trojan problem</a>, but
 
192
      it is an order of a magnitude slower, and requires more bandwith. 
 
193
      Set to &quot;gnosis&quot; for Gnosis XML pickler. There are no other options available at this time.
 
194
      You need to have installed <a href=
 
195
      "http://gnosis.cx/download/">Gnosis_Utils</a> (at least version 1.2.x).
 
196
      Note that you have to use the same Gnosis XML library version everywhere. You can't mix older versions with newer versions. </td>
 
197
      <td><i>empty</i> (disabled)</td>
 
198
    </tr>
 
199
 
 
200
    <tr>
 
201
      <td><code>PYRO_GNOSIS_PARANOIA</code></td>
 
202
      <td>number</td>
 
203
      <td>The 'paranoia' setting that will be used for the Gnosis XML pickler. Higher=more secure. 
 
204
        The default setting (0) prevents automatic imports of modules during unpickling. 
 
205
        Set it to -1 to enable automatic imports of user defined modules.
 
206
        When you use the mobile code feature together with Gnosis XML pickling, you need
 
207
        to set it to -1 as well.</td>
 
208
      <td>0</td>
 
209
    </tr>
 
210
 
 
211
    <tr>
 
212
      <td><code>PYRO_COMPRESSION</code></td>
 
213
 
 
214
      <td>boolean</td>
 
215
 
 
216
      <td>Whether the protocol should compress the data to save bandwidth (at the cost of CPU time). The
 
217
      <code>zlib</code> module is used for compression. If you don't have <code>zlib</code>, Pyro still works, but
 
218
      without compression.</td>
 
219
 
 
220
      <td>0</td>
 
221
    </tr>
 
222
 
 
223
    <tr>
 
224
      <td><code>PYRO_CHECKSUM</code></td>
 
225
 
 
226
      <td>boolean</td>
 
227
 
 
228
      <td>Whether the protocol should perform a checksum over the message data. This costs a little bit extra CPU time,
 
229
      but you will be quite sure that your communication is without errors. The <code>zlib.adler32</code> function is
 
230
      used for checksumming. If you don't have <code>zlib</code>, Pyro still works, but without checksumming. The
 
231
      overhead of checksumming is very small, with regular messages less than 0.1%, but increasing with big messages
 
232
      (15% for 5 Mb or so). <strong>Note:</strong> the checksum is by no means secure. If you want secure
 
233
      transmissions, you'll have to use SSL or build your own encryption/secure hashing functions on top of Pyro.</td>
 
234
 
 
235
      <td>0</td>
 
236
    </tr>
 
237
 
 
238
    <tr>
 
239
      <td><code>PYRO_SOCK_KEEPALIVE</code></td>
 
240
 
 
241
      <td>boolean</td>
 
242
 
 
243
      <td>Whether Pyro should set the SO_KEEPALIVE socket option on the network sockets. This is used
 
244
          to detect broken client connections, to let the Pyro server clean them up nicely. It is enabled
 
245
          by default, but it could cause problems in certain situations so you can turn it off if you
 
246
          want. The timeout period is system-dependent but usually around 2 hours. It depends on your
 
247
          OS how to change this value, but have a look at &quot;sysctl&quot;. (This
 
248
      feature may not be available on all OS's, if your OS doesn't support it, Pyro will automatically
 
249
          switch it off).</td>
 
250
 
 
251
      <td>1</td>
 
252
    </tr>
 
253
 
 
254
    <tr>
 
255
      <td><code>PYRO_MAXCONNECTIONS</code></td>
 
256
 
 
257
      <td>number</td>
 
258
 
 
259
      <td>The maximum number of simultaneous connections to one Pyro server. Note that a custom connection validator
 
260
      may or may not take this in account. The default validator does check for this limit.</td>
 
261
 
 
262
      <td>200</td>
 
263
    </tr>
 
264
 
 
265
    <tr>
 
266
      <td><code>PYRO_TCP_LISTEN_BACKLOG</code></td>
 
267
 
 
268
      <td>number</td>
 
269
 
 
270
      <td>The size of the TCP socket listen backlog for Pyro daemons.</td>
 
271
 
 
272
      <td>200</td>
 
273
    </tr>
 
274
 
 
275
    <tr>
 
276
        <td><code>PYRO_BROKEN_MSGWAITALL</code></td>
 
277
        <td>boolean</td>
 
278
        <td>Some systems have broken socket MSG_WAITALL support. Set this item to 1 if your system is one of these. When
 
279
        set to 1, Pyro will use a different piece of code to receive data (slower, but working on these systems as well). </td>
 
280
        <td>0</td>
 
281
    </tr>
 
282
    <tr>
 
283
      <td><code>PYRO_MULTITHREADED</code></td>
 
284
 
 
285
      <td>boolean</td>
 
286
 
 
287
      <td>Whether Pyro servers should be multithreaded or not.</td>
 
288
 
 
289
      <td>1 (if supported)</td>
 
290
    </tr>
 
291
 
 
292
    <tr>
 
293
      <td><code>PYRO_MOBILE_CODE</code></td>
 
294
 
 
295
      <td>boolean</td>
 
296
 
 
297
      <td>On the server: whether Pyro should automatically download Python code from clients if it isn't available on
 
298
      the server. On the client: whether Pyro should automatically download Python code from the server if it returns
 
299
      objects that aren't available on the client.</td>
 
300
 
 
301
      <td>0</td>
 
302
    </tr>
 
303
 
 
304
    <tr>
 
305
      <td><code>PYRO_DNS_URI</code></td>
 
306
 
 
307
      <td>boolean</td>
 
308
 
 
309
      <td>Whether symbolic DNS host names should be used in URIs instead of fixed IP addresses.</td>
 
310
 
 
311
      <td>0</td>
 
312
    </tr>
 
313
 
 
314
    <tr>
 
315
      <td><code>PYRO_BC_RETRIES</code></td>
 
316
 
 
317
      <td>number</td>
 
318
 
 
319
      <td>How often a broadcast will be retried if no answer has been received. Currently only used by the Name Server
 
320
      locator. A negative number (&lt;0) means infinitely. </td>
 
321
 
 
322
      <td>2</td>
 
323
    </tr>
 
324
 
 
325
    <tr>
 
326
      <td><code>PYRO_BC_TIMEOUT</code></td>
 
327
 
 
328
      <td>number</td>
 
329
 
 
330
      <td>How long Pyro will wait (in seconds) for an answer to a broadcast request. Currently only used by the Name
 
331
      Server locator. A negative number (&lt;0) means infinitely.</td>
 
332
 
 
333
      <td>2</td>
 
334
    </tr>
 
335
 
 
336
    <tr>
 
337
      <td><code>PYRO_PORT</code></td>
 
338
 
 
339
      <td>number</td>
 
340
 
 
341
      <td>The base socket number of the range of socket numbers that the Pyro daemon can use to listen for incoming
 
342
      requests (Pyro method calls).</td>
 
343
 
 
344
      <td>7766</td>
 
345
    </tr>
 
346
 
 
347
    <tr>
 
348
      <td><code>PYRO_PORT_RANGE</code></td>
 
349
 
 
350
      <td>number</td>
 
351
 
 
352
      <td>The size of the socket port range. Pyro will try to claim a socket for its Deamons in the socket port range
 
353
      PYRO_PORT to (but not including) PYRO_PORT+PYRO_PORT_RANGE. This means that if Pyro already has a Daemon listning
 
354
      on socket N, a new Deamon will claim socket N+1, and so on. You can disable this by using a special argument when
 
355
      construction a Daemon (or setting this item to 1).</td>
 
356
 
 
357
      <td>100</td>
 
358
    </tr>
 
359
 
 
360
    <tr>
 
361
      <td><code>PYRO_HOST</code></td>
 
362
 
 
363
      <td>string</td>
 
364
 
 
365
      <td>The hostname Pyro's daemon will bind on. Useful when your machine has multiple hostnames/network adapters
 
366
        on which it can listen. (Also influences NameServer.)</td>
 
367
 
 
368
      <td>'' <em>(default host)</em></td>
 
369
    </tr>
 
370
 
 
371
    <tr>
 
372
      <td><code>PYRO_PUBLISHHOST</code></td>
 
373
 
 
374
      <td>string</td>
 
375
 
 
376
      <td>the hostname that Pyro daemons will use when publishing URIs. Useful in case of a firewall/NAT setup.
 
377
        See the Features chapter for firewall info. </td>
 
378
 
 
379
      <td>None <em>(same as normal hostname)</em></td>
 
380
    </tr>
 
381
 
 
382
    <tr>
 
383
      <td><code>PYRO_NS_DEFAULTGROUP</code></td>
 
384
 
 
385
      <td>string</td>
 
386
 
 
387
      <td>The default group name in which names are located. <em>This must be an absolute name (starting with the root
 
388
      character).</em></td>
 
389
 
 
390
      <td><code>:Default</code></td>
 
391
    </tr>
 
392
 
 
393
    <tr>
 
394
      <td><code>PYRO_NS_URIFILE</code></td>
 
395
 
 
396
      <td>string</td>
 
397
 
 
398
      <td>The file where the Name Server will write its URI. If it's not an absolute path, it's relative to
 
399
      <code>$PYRO_STORAGE</code>.</td>
 
400
 
 
401
      <td><code>Pyro_NS_URI</code></td>
 
402
    </tr>
 
403
 
 
404
    <tr>
 
405
      <td><code>PYRO_NS_HOSTNAME</code></td>
 
406
 
 
407
      <td>string</td>
 
408
 
 
409
      <td>The hostname that is tried to find the NameServer on, when the broadcast lookup mechanism fails.</td>
 
410
 
 
411
      <td><i>empty</i></td>
 
412
    </tr>
 
413
 
 
414
    <tr>
 
415
      <td><code>PYRO_NS_PORT</code></td>
 
416
 
 
417
      <td>number</td>
 
418
 
 
419
      <td>The socket number on which the Name Server will listen for incoming requests (Pyro method calls, in
 
420
      fact).</td>
 
421
 
 
422
      <td>9090</td>
 
423
    </tr>
 
424
 
 
425
    <tr>
 
426
      <td><code>PYRO_NS_BC_PORT</code></td>
 
427
 
 
428
      <td>number</td>
 
429
 
 
430
      <td>The socket number on which the Name Server will listen for broadcast requests (usually to find the
 
431
      location).</td>
 
432
 
 
433
      <td>9090</td>
 
434
    </tr>
 
435
 
 
436
    <tr>
 
437
      <td><code>PYRO_NS2_HOSTNAME</code></td>
 
438
 
 
439
      <td>string</td>
 
440
 
 
441
      <td>Like above, but for the second (paired) Name Server.</td>
 
442
 
 
443
      <td><i>empty</i></td>
 
444
    </tr>
 
445
 
 
446
    <tr>
 
447
      <td><code>PYRO_NS2_PORT</code></td>
 
448
 
 
449
      <td>number</td>
 
450
 
 
451
      <td>Like above, but for the second (paired) Name Server.</td>
 
452
 
 
453
      <td>9091</td>
 
454
    </tr>
 
455
 
 
456
    <tr>
 
457
      <td><code>PYRO_NS2_BC_PORT</code></td>
 
458
 
 
459
      <td>number</td>
 
460
 
 
461
      <td>Like above, but for the second (paired) Name Server.</td>
 
462
 
 
463
      <td>9091</td>
 
464
    </tr>
 
465
 
 
466
    <tr>
 
467
      <td><code>PYRO_ES_QUEUESIZE</code></td>
 
468
 
 
469
      <td>number</td>
 
470
 
 
471
      <td>The size of the message queues per subscriber that the Event Server allocates. Use 0 (zero) for infinite
 
472
      size.</td>
 
473
 
 
474
      <td>1000</td>
 
475
    </tr>
 
476
 
 
477
    <tr>
 
478
      <td><code>PYRO_ES_BLOCKQUEUE</code></td>
 
479
 
 
480
      <td>boolean</td>
 
481
 
 
482
      <td>If true (1), a publisher will block if an event queue on the server is full, and continue as soon as the
 
483
      queue has some space again. If false (0), the publisher won't block, but <em>the event is lost</em>
 
484
      (but only for the subscriber who has a full queue).</td>
 
485
 
 
486
      <td>1</td>
 
487
    </tr>
 
488
 
 
489
    <tr>
 
490
      <td><code>PYROSSL_CERTDIR</code></td>
 
491
 
 
492
      <td>string</td>
 
493
 
 
494
      <td>The directory where openssl certificates are stored.</td>
 
495
 
 
496
      <td>'certs' in the PYRO_STORAGE location.</td>
 
497
    </tr>
 
498
 
 
499
    <tr>
 
500
      <td><code>PYROSSL_CA_CERT</code></td>
 
501
 
 
502
      <td>string</td>
 
503
 
 
504
      <td>Certificate of the Certificate Authority. Used to check if client and server certificates are valid (that
 
505
      they are signed by the given CA)</td>
 
506
 
 
507
      <td>ca.pem</td>
 
508
    </tr>
 
509
 
 
510
    <tr>
 
511
      <td><code>PYROSSL_SERVER_CERT</code></td>
 
512
 
 
513
      <td>string</td>
 
514
 
 
515
      <td>Certificate for server side</td>
 
516
 
 
517
      <td>server.pem</td>
 
518
    </tr>
 
519
 
 
520
    <tr>
 
521
      <td><code>PYROSSL_CLIENT_CERT</code></td>
 
522
 
 
523
      <td>string</td>
 
524
 
 
525
      <td>Certificate for client side</td>
 
526
 
 
527
      <td>client.pem</td>
 
528
    </tr>
 
529
  </table>
 
530
 
 
531
  <p>There are several ways to change the default settings:</p>
 
532
 
 
533
  <ol>
 
534
    <li>Change the settings in your code, at runtime. You can change all settings before starting Pyro, and most
 
535
    settings can be changed dynamically during execution too. <em>Note that you cannot use this to change
 
536
    <code>Pyro.config.PYRO_STORAGE</code>! See below!</em><br>
 
537
    ... <code>Pyro.config.PYRO_PORT = 7000</code><br>
 
538
    ... <code>Pyro.config.PYRO_TRACELEVEL = 3</code></li>
 
539
 
 
540
    <li>Define environment variables that override the default settings.<br>
 
541
    Every configuration item has an equivalent environment variable. If you define this, you can override the default
 
542
    setting for that item. For instance, it might be convenient to have your Pyro programs generate log files and put
 
543
    them in a designated log directory:<br>
 
544
    ...<code>$ export PYRO_LOGFILE=/var/log/PYRO/logfile</code><br>
 
545
    ...<code>$ export PYRO_TRACELEVEL=3</code><br>
 
546
    (This is for bash - syntax is different for other shells or Windows.)</li>
 
547
 
 
548
    <li>Configuration files<br>
 
549
      You can use a configuration file that can contain some small configuration changes or a fully new configuration
 
550
      for all items. Pyro checks if the environment variable <code>PYRO_CONFIG_FILE</code> is set. If it isn't set, or
 
551
      set to an empty string, Pyro checks for a <code>Pyro.conf</code> file in the current directory. If it exists,
 
552
      Pyro uses it as a configuration file. If it doesn't exist, Pyro uses the default built-in configuration.<br>
 
553
      If the environment variable is set, Pyro uses the value as the name for the configuration file. If the
 
554
      configuration file can't be read, a PyroError exception occurs.
 
555
 
 
556
      <p>The format of the configuration file is very simple. It is a text file, and each line can be empty, a comment,
 
557
      or a configuration item setting. A comment starts with '#'. A config item setting is of the format 'ITEM=VALUE'.
 
558
      If Pyro finds an unknown config item, a KeyError exception occurs.</p>
 
559
 
 
560
      <p>Note that <code>PYRO_CONFIG_FILE</code> is useless inside a configuration file. After initialization, it is
 
561
      set to the absolute path of the configuration file that was used (or the empty string, if no configuration file
 
562
      was used). Note that setting <code>PYRO_CONFIG_FILE</code> from within your code is useless too because Pyro is
 
563
      already initialized at that point.</p>
 
564
    </li>
 
565
  </ol>Environment variables override configuration file settings. Configuration file settings override the built-in
 
566
  default settings.
 
567
 
 
568
  <p><code>PYRO_STORAGE</code> is used at initialization time, that is, as soon as a part of the Pyro package is
 
569
  imported in your program. You can only change <code>PYRO_STORAGE</code> <em>beforehand</em> by either setting the
 
570
  environment variable or making an entry in the configuration file. Changing <code>Pyro.config.PYRO_STORAGE</code> in
 
571
  your program leads to unexpected results, because the initilization has already been done using the old value. So
 
572
  don't do this, and use one of the two other ways.</p>
 
573
<div class="nav">
 
574
<hr>
 
575
  <table width="100%">
 
576
    <tr>
 
577
      <td align="left"><a href="2-concepts.html">&lt;previous</a> | <a href="PyroManual.html">contents</a> | <a href=
 
578
      "4-usage.html">next&gt;</a></td>
 
579
 
 
580
      <td align="right">Pyro Manual</td>
 
581
    </tr>
 
582
  </table></div>
265
583
</body>
266
584
</html>