1xpaenv(n) SAORD Documentation xpaenv(n)
2
3
4
6 XPAEnv: Environment Variables for XPA Messaging
7
9 Describes the environment variables which can be used to tailor the
10 overall XPA environment.
11
13 The following environment variables are supported by XPA:
14
15 · XPA_ACL
16
17 If XPA_ACL is true, then host-based XPA Access Control is turned on
18 and only specified machines can access specified access points. If
19 false, then access control is turned off and any machine can access
20 point. The default is turn turn access control on.
21
22 · XPA_ACLFILE
23
24 If XPA Access Control is turned on, this variable specifies the
25 name of the file containing access control information for all
26 access points started by this user. The default file name is:
27 $HOME/acls.xpa.
28
29 · XPA_CONNECT_TIMEOUT
30
31 When an XPA server first starts up, it immediately tries to connect
32 to the XPA name server program (xpans) on the host specified by the
33 XPA_NSINET variable. (If this connection fails on the local host,
34 and if xpans can be found in the path, then the name server is
35 started automatically.) Unfortunately, a mis-configured network
36 can cause this connect attempt to hang for many seconds while the
37 connect() system call times out. Therefore, an alarm is started to
38 interrupt the connect() call and prevent a long hang. The initial
39 value of the alarm timeout is 10 seconds, but can be changed by
40 setting this environment variable. If you want to disable the alarm
41 and allow the initial connect() to time out, set the value of this
42 variable to 0. Normally, users would not change this variable at
43 all.
44
45 · XPA_CLIENT_DOXPA
46
47 Normally, an XPA client (xpaget, xpaset, etc.) will process incom‐
48 ing XPA server requests while awaiting the completion of the client
49 request. Setting this variable to "false" will prevent XPA server
50 requests from being processed by the client.
51
52 · XPA_DEFACL
53
54 If XPA Access Control is turned on, this variable specifies the
55 default access control condition for all access points, if the
56 XPA_ACLFILE file does not exist. The default acl is: $host:* $host
57 +, meaning that all processes on the host machine have full access
58 to all access points.
59
60 · XPA_IOCALLSXPA
61
62 Setting this variable causes all XPA socket IO calls to process
63 outstanding XPA requests whenever the primary socket is not ready
64 for IO. This means that a server making a client call will (recur‐
65 sively) process incoming server requests while waiting for client
66 completion. This inter-IO XPA processing avoids a rare XPA Race
67 Condition: two or more XPA servers sending messages to one another
68 using an XPA client routine such as XPASet() can deadlock while
69 each waits for the other server to respond. This can happen, for
70 example, if the servers call XPAPoll() with a time limit, and send
71 messages in between the polling call.
72
73 By default, this option is turned off, because we judge that the
74 added code complication and overhead involved will not be justified
75 by the amount of its use. Moreover, processing XPA requests within
76 socket IO can lead to non-intuitive results, since incoming server
77 requests will not necessarily be processed to completion in the
78 order in which they are received.
79
80 · XPA_METHOD
81
82 Determines the socket connection method used by this session of
83 XPA. The choices are: inet (to use INET or Internet-based sock‐
84 ets), localhost (to use the machines localhost inet socket), or
85 local (unix) (to use UNIX sockets). The default is INET. Using the
86 inet method will allow access from other machines (subject to
87 access controls) but using localhost or local will not. Localhost
88 is most useful for private access and when the machine in question
89 is not connected to the Internet. The unix method also can be used
90 for private access and non-Internet connections (Unix platforms
91 only).
92
93 Once defined, the first registration of an XPA access point will
94 ensure that an instance of the XPA Name Server (xpans) is running
95 that handles that connection method. All new access points will use
96 the new connection method but existing access points will use the
97 original method.
98
99 · XPA_LOGNAME
100
101 XPA preferentially uses the de facto standard environment variable
102 LOGNAME to determine the username when registering an access point
103 in the name server. If this environment variable has been used for
104 something other than the actual user name (such as a log file
105 name), unexpected results can ensue. In such cases, use the
106 XPA_LOGNAME variable to set the user name. (If neither exists, then
107 getpwuid(geteuid()) is used as a last resort).
108
109 · XPA_LONG_TIMEOUT
110
111 XPA is designed to allow data to be sent from one process to
112 another over a long period of time (i.e., a program that generates
113 image data sends that data to an image display, but slowly) but it
114 also seeks to prevent hangs. This is done by supporting 2 timeout
115 periods: a short timeout for protocol communication and a long for
116 data communication.
117
118 The XPA_LONG_TIMEOUT variable controls the long timeout and is used
119 to prevent hangs in cases where communication between the client
120 and server that is not controlled by the XPA interface itself.
121 Transfer of data between client and server, or a client's wait for
122 a status message after completion of the server callback, are two
123 examples of this sort of communication. By default, the long time‐
124 out is set to 180 seconds. Setting the value to -1 will disable
125 long timeouts and allow an infinite amount of time.
126
127 · XPA_MAXHOSTS
128
129 The maximum number of access points that the programs xpaset,
130 xpaget, and xpainfo will communicate with at one time. The default
131 is 64, meaning, for example, that the xpaset program will not send
132 a message to more than 100 access points at one time and xpaget
133 will not retrieve from more than 100 access points at one time.
134
135 · XPA_NSINET
136
137 For the inet method of socket connection, this variable specifies
138 the host and port on which the XPA Name Server (xpans) is listens
139 for new access points. The default is $host:$port, meaning that the
140 default XPA port (14285) on the current machine is used. If several
141 machines were all accessing the same XPA access points, you would
142 use this variable to specify that they all use the same name server
143 to find out about these access points. For example, a value of
144 myhost:$port would mean that the xpans name server is running on
145 myhost and uses the default port 12345. All machines would then
146 get the XPA access points registered with that name server, subject
147 to access controls.
148
149 The port used by xpans to register its XPA access point normally is
150 taken to be one greater than the port on which it receives new
151 access points from XPA servers. You can specify a specific access
152 point port using the syntax machine:port1,port2, i.e., the access
153 point port is specified after the comma. For example,
154 $host:12345,23456 will listen for new access ports on 12345 and
155 will accept XPA commands on 23456.
156
157 · XPA_NSUNIX
158
159 For the local method of socket connection, this variable specifies
160 the name of the Unix file that will be used to access the XPA Name
161 Server (xpans). The default is xpans_unix. This variable is not
162 usually needed. Note that is the local socket method is used, then
163 remote machines will not be able to access the xpans name server or
164 the registered XPA access points.
165
166 · XPA_NSUSERS
167
168 This variable specifies whether other users' access points will be
169 returned by the XPA Name Server (xpans) for use by xpaget, xpaset,
170 etc. Generally speaking, it is sufficient to run one xpans name
171 server per machine and register the access points for all users
172 with that xpans. This means, for example, that if you request
173 information from ds9 by running:
174
175 xpaget ds9 colormap
176
177 you might get information from your own ds9 as well as from another
178 user running ds9 on the same machine. The XPA_NSUSERS variable
179 controls whether you want such access to the access points of other
180 users. By default, only your own access points are returned, so
181 that, in the example above, you would only get the colormap infor‐
182 mation from the ds9 you registered. If, however, you had set the
183 value of the XPA_NSUSERS variable to eric,fred, then you would be
184 able to communicate with both eric and fred's access points. Note
185 that this variable can be overridden using the -u switch on the
186 xpaget, xpaset, and xpainfo programs.
187
188 · XPA_NSREGISTER
189
190 This boolean variable specifies whether a server registers its XPA
191 access point with the specified xpans name server. The default is
192 true. If set to false, the access point still is set up but it is
193 not registered with xpans and therefore cannot be accessed by name.
194 (It can be accessed by method, if the latter is known.) Note that
195 an access point can be registered later on (using -remote or
196 -proxy, for example). This variable mainly is useful in cases where
197 the Internet configuration is broken (so that registration causes a
198 DNS hang) but you still wish to and can use the server with a
199 remote xpans (e.g., ds9's Virtual Observatory capability).
200
201 · XPA_PORT
202
203 A semi-colon delimited list of user specified ports to use for spe‐
204 cific XPA access points. The format is each specification is:
205
206 class:template port1[ port2]
207
208 where port1 is the main (command) port for the access point and
209 port2 is the (secondary) data port. If port2 is not specified, it
210 defaults to a value of 0 (meaning the system assigns the port).
211
212 Specification of specific ports is useful, for example, when a
213 machine outside a firewall needs to communicate with a machine
214 inside a firewall. In such a case, the firewall should be config‐
215 ured to allow socket connections to both the command and data port
216 from the outside machine, and the inside XPA program should be
217 started up with the outside machine in its ACL list. Then, when the
218 inside program is started with specified ports, outside XPA pro‐
219 grams can use "machine:port" to contact the inside access points,
220 instead of the access point names. That is, the machine outside the
221 firewall does not need access to the XPA name server:
222
223 export XPA_PORT="DS9:ds9 12345 12346" # on machine "inside" cat
224 foo.fits ⎪ xpaset inside:12345 fits # on machine "outside"
225
226 Note that 2 ports are required for full XPA communication and
227 therefore 2 ports should be specified to go through a firewall.
228 The second port assignment is not important if you simply are
229 assigning the command port in order to communicate commands with a
230 known port (e.g., to bypass the xpans name server). If only one
231 (command) port is specified, the system will negotiate a random
232 data port and everything will work properly.
233
234 This support is somewhat experimental. If you run into problems,
235 please let us know.
236
237 · XPA_PORTFILE
238
239 A list of user-specified port to use for specific xpa access
240 points. The format of the file is:
241
242 class:template port1 [port2]
243
244 where port1 is the main port for the access point and port2 is the
245 data port. If port2 is not specified, it defaults to a value of 0
246 (meaning the system assigns the port). See XPA_PORT above for an
247 explanation of user-specified ports.
248
249 · XPA_SHORT_TIMEOUT
250
251 XPA is designed to allow data to be sent from one process to
252 another over a long period of time (i.e., a program that generates
253 image data sends that data to an image display, but slowly) but it
254 also seeks to prevent hangs. This is done by supporting 2 timeout
255 periods: a short timeout for protocol communication and a long for
256 data communication.
257
258 The XPA_SHORT_TIMEOUT variable controls the short timeout and is
259 used to prevent hangs in cases where the XPA protocol requires
260 internal communication between the client and server that is con‐
261 trolled by the XPA interface itself. Authentication is an example
262 of this sort of communication, as is the establishment of a data
263 channel between the two processes. The default value for the short
264 is 30 seconds (which is a pretty long time, actually). Setting the
265 value to -1 will disable short timeouts and allow an infinite
266 amount of time.
267
268 · XPA_TMPDIR
269
270 This variable specifies the directory into which XPA logs, Unix
271 socket files (when XPA_METHOD is local), etc. are stored. The
272 default is /tmp/.xpa.
273
274 · XPA_SIGUSR1
275
276 If the value of this variable is true, then XPA will catch SIGUSR1
277 signals when performing an I/O operation in order to curtail that
278 operation. This facility allows users to send a SIGUSR1 signal to
279 an XPA server if a client is hanging up the server by sending or
280 receiving data too slowly (timeouts also can be used -- see above).
281 When enabled in this way, the SIGUSR1 signal is ignored at all
282 other times, so that its safe to send the signal at any time. If
283 the variable is set to false, then SIGUSR1 is not used at all.
284 Turning off SIGUSR1 would be desired in cases there the program
285 uses SIGUSR1 for some other reason and does not want XPA interfer‐
286 ing. The default is to use the signal.
287
288 · XPA_VERBOSITY
289
290 Specify the verbosity level of error messages. If the value is set
291 to 0, false, or off, then no error messages are printed to stderr.
292 If the value is 1, then important XPA error messages will be out‐
293 put. If the value is set to 2, XPA warnings about out-of-sync mes‐
294 sages will also be output. These latter almost always can be
295 ignored.
296
297 · XPA_VERSIONCHECK
298
299 Specify whether a new access point should check its major and minor
300 XPA version number against the version used by the xpans name
301 server at registration time. The default is true. When checking is
302 performed, a warning is issued if the server major version is found
303 to be greater than the xpans version. Note that the check is per‐
304 formed both by the XPA server and by the xpans process and warnings
305 will be issued by each. Also, instead of the values of true or
306 false, you can give this variable an integer value n. In this case,
307 each version checking process (i.e., the XPA-enabled server or
308 xpans) will print out a maximum of n warning messages (after which
309 version warnings are silently swallowed).
310
311 In general, it is a bad idea to run an XPA-enabled server program
312 using a version of XPA newer than the basic xpaset, xpaget, xpaac‐
313 cess, xpans programs. This sort of mismatch usually will not work
314 due to protocol changes.
315
316 · XPA_TIMESTAMP_ERRORS
317
318 If XPA_TIMESTAMP_ERRORS is true, then error messages will include a
319 date/time string. This can be useful when XPA errors are being
320 saved in an error log (e.g. Web/CGI use). The default is false.
321
323 See xpa(n) for a list of XPA help pages
324
325
326
327version 2.1.8 November 1, 2007 xpaenv(n)