xpaenv(7)

πŸŽ€ NAME πŸŽ€

bestie, meet xpaenv β€” a manual page from section 7, brought to you by SAORD Documentation. Its government name is XPAEnv: Environment Variables for XPA Messaging, and it's basically the master list of every env var that tweaks how XPA talks to itself. iykyk πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

This page lays out all the environment variables you can use to tailor the whole XPA environment. That's it, that's the synopsis. slay. ✨


πŸ’– DESCRIPTION πŸ’–

XPA supports the following environment variables, and every single one of them matters, so let's go one by one, no skipping, periodt:

  • XPA_ACL β€” if this is true, host-based XPA Access Control is on, which means only the machines you specify can reach the access points you specify. If it's false, access control is off and literally any machine can access a point. Default vibe: access control is turned on. πŸ”₯
  • XPA_ACLFILE β€” when XPA Access Control is on, this variable names the file that holds the access control info for all access points started by this user. The default file name is $HOME/acls.xpa. πŸ“
  • XPA_CONNECT_TIMEOUT β€” okay so when an XPA server first starts up, it immediately tries to connect to the XPA name server program (xpans) on the host named by the XPA_NSINET variable. (If that connection fails on the local host, and if xpans can be found in the path, then the name server gets started automatically.) Tragically, a mis-configured network can make this connect attempt hang for many seconds while the connect() system call times out. So an alarm is started to interrupt the connect() call and stop the long hang. The initial value of that alarm timeout is 10 seconds, but you can change it with this environment variable. If you want to disable the alarm entirely and just let the initial connect() time out, set this variable to 0. Normally, though? Users would not change this variable at all. 🫢
  • XPA_CLIENT_DOXPA β€” normally, an XPA client (xpaget, xpaset, etc.) will process incoming XPA server requests while it's awaiting completion of the client request. Setting this variable to "false" stops the client from processing those XPA server requests. πŸ™ˆ
  • XPA_DEFACL β€” if XPA Access Control is on, this variable gives the default access control condition for all access points, for when the XPA_ACLFILE file does not exist. The default acl is $host:* $host +, which means all processes on the host machine have full access to all access points. πŸ‘‘
  • XPA_HOST β€” for the INET socket method, XPA uses the canonical hostname (as returned by the gethostname() routine) to build the IP part of the method id. Under some circumstances that might not be the right name and IP choice. For example, if an XPA server is started on a machine running VPN, you might want the VPN name and IP instead of the canonical host name, so that other machines on the VPN network can reach the server. In that case, set XPA_HOST to the VPN name (if it's resolvable) or, more easily, to the VPN IP. 🌐
  • XPA_IOCALLSXPA β€” setting this variable makes all XPA socket IO calls process outstanding XPA requests whenever the primary socket isn't ready for IO. What that means: a server making a client call will (recursively) process incoming server requests while waiting for client completion. This inter-IO XPA processing avoids a rare XPA Race Condition β€” two or more XPA servers sending messages to one another using an XPA client routine such as XPASet() can deadlock while each waits for the other server to respond. This can happen, for example, if the servers call XPAPoll() with a time limit, and send messages in between the polling call.

By default this option is turned off, because we judge that the added code complication and overhead involved will not be justified by the amount of its use. And also, processing XPA requests within socket IO can lead to non-intuitive results, since incoming server requests will not necessarily be processed to completion in the order in which they are received. πŸ’€

  • XPA_LOGNAME β€” XPA preferentially uses the de facto standard environment variable LOGNAME to figure out the username when registering an access point in the name server. If this environment variable has been used for something other than the actual user name (like, say, a log file name), unexpected results can ensue. In such cases, use the XPA_LOGNAME variable to set the user name. (If neither exists, then getpwuid(geteuid()) is used as a last resort.) 🫠
  • XPA_LONG_TIMEOUT β€” XPA is designed to let data be sent from one process to another over a long period of time (i.e., a program that generates image data sends that data to an image display, but slowly), but it also wants to prevent hangs. It does this by supporting 2 timeout periods: a short timeout for protocol communication and a long one for data communication.

The XPA_LONG_TIMEOUT variable controls the long timeout and is used to prevent hangs in cases where communication between the client and server isn't controlled by the XPA interface itself. Transfer of data between client and server, or a client's wait for a status message after completion of the server callback, are two examples of this sort of communication. By default, the long timeout is set to 180 seconds. Setting the value to -1 will disable long timeouts and allow an infinite amount of time. ⏳

  • XPA_MAXHOSTS β€” the maximum number of access points that the programs xpaset, xpaget, and xpainfo will communicate with at one time. The default is 64, meaning, for example, that the xpaset program will not send a message to more than 100 access points at one time and xpaget will not retrieve from more than 100 access points at one time. πŸ”’
  • XPA_METHOD β€” determines the socket connection method used by this session of XPA. The choices are: inet (to use INET or Internet-based sockets), localhost (to use the machine's localhost inet socket), or local (unix) (to use UNIX sockets). The default is INET. Using the inet method will allow access from other machines (subject to access controls), but using localhost or local will not. localhost is most useful for private access and when the machine in question isn't connected to the Internet. The unix method also can be used for private access and non-Internet connections (Unix platforms only).

Once defined, the first registration of an XPA access point will ensure that an instance of the XPA Name Server (xpans) is running that handles that connection method. All new access points will use the new connection method, but existing access points will use the original method. 🌈

  • XPA_NSINET β€” for the inet method of socket connection, this variable specifies the host and port on which the XPA Name Server (xpans) listens for new access points. The default is $host:$port, meaning that the default XPA port (14285) on the current machine (as returned by gethostname()) is used. If several machines were all accessing the same XPA access points, you'd use this variable to specify that they all use the same name server to find out about these access points. For example, a value of myhost:$port would mean that the xpans name server is running on myhost and uses the default port 12345. All machines would then get the XPA access points registered with that name server, subject to access controls.

The port used by xpans to register its XPA access point normally is taken to be one greater than the port on which it receives new access points from XPA servers. You can specify a specific access point port using the syntax machine:port1,port2, i.e., the access point port is specified after the comma. For example, $host:12345,23456 will listen for new access ports on 12345 and will accept XPA commands on 23456. πŸ”Œ

  • XPA_NSREGISTER β€” this boolean variable specifies whether a server registers its XPA access point with the specified xpans name server. The default is true. If set to false, the access point still is set up but it is not registered with xpans and therefore cannot be accessed by name. (It can be accessed by method, if the latter is known.) Note that an access point can be registered later on (using -remote or -proxy, for example). This variable mainly is useful in cases where the Internet configuration is broken (so that registration causes a DNS hang) but you still wish to and can use the server with a remote xpans (e.g., ds9's Virtual Observatory capability). πŸ›°οΈ
  • XPA_NSUNIX β€” for the local method of socket connection, this variable specifies the name of the Unix file that will be used to access the XPA Name Server (xpans). The default is xpans_unix. This variable is not usually needed. Note that if the local socket method is used, then remote machines will not be able to access the xpans name server or the registered XPA access points. 🐧
  • XPA_NSUSERS β€” this variable specifies whether other users' access points will be returned by the XPA Name Server (xpans) for use by xpaget, xpaset, etc. Generally speaking, it's sufficient to run one xpans name server per machine and register the access points for all users with that xpans. This means, for example, that if you request information from ds9 by running:
xpaget ds9 colormap

you might get information from your own ds9 as well as from another user running ds9 on the same machine. The XPA_NSUSERS variable controls whether you want such access to the access points of other users. By default, only your own access points are returned, so that, in the example above, you would only get the colormap information from the ds9 you registered. If, however, you had set the value of the XPA_NSUSERS variable to eric,fred, then you would be able to communicate with both eric and fred's access points. Note that this variable can be overridden using the -u switch on the xpaget, xpaset, and xpainfo programs. πŸ‘―

  • XPA_PORT β€” a semi-colon delimited list of user specified ports to use for specific XPA access points. The format of each specification is:
class:template port1[ port2]

where port1 is the main (command) port for the access point and port2 is the (secondary) data port. If port2 is not specified, it defaults to a value of 0 (meaning the system assigns the port). 🎯


part 1 done, bestie β€” there's more coming, don't go anywhere πŸ’œ

Okay so specifying specific ports is lowkey iconic when, like, a machine outside a firewall needs to talk to a machine inside a firewall 🫢. In that case the firewall should be configured to allow socket connections to both the command and data port from the outside machine, and the inside XPA program should be started up with the outside machine in its ACL list ✨. Then, when the inside program is started with specified ports, outside XPA programs can use "machine:port" to contact the inside access points, instead of the access point names. Which basically means the machine outside the firewall does not need access to the XPA name server at all πŸ’…:

export XPA_PORT="DS9:ds9 12345 12346"   # on machine "inside" cat
foo.fits | xpaset inside:12345 fits # on machine "outside"

Not me about to state the obvious but β€” 2 ports are required for full XPA communication, so bestie, you need to specify 2 ports to go through a firewall 😭. The second port assignment is not important if you simply are assigning the command port in order to communicate commands with a known port (e.g., to bypass the xpans name server). If only one (command) port is specified, the system will negotiate a random data port and everything will work properly. Slay 🌈.

This support is somewhat experimental. If you run into problems, please let us know πŸ’œ.

  • XPA_PORTFILE β€” a list of user-specified port to use for specific xpa access points πŸŽ€. The format of the file is:
class:template port1 [port2]

where port1 is the main port for the access point and port2 is the data port. If port2 is not specified, it defaults to a value of 0 (meaning the system assigns the port). See XPA_PORT above for an explanation of user-specified ports πŸ‘‘

  • XPA_SHORT_TIMEOUT β€” XPA is designed to allow data to be sent from one process to another over a long period of time (i.e., a program that generates image data sends that data to an image display, but slowly) but it also seeks to prevent hangs πŸ¦‹. This is done by supporting 2 timeout periods: a short timeout for protocol communication and a long for data communication.

The XPA_SHORT_TIMEOUT variable controls the short timeout and is used to prevent hangs in cases where the XPA protocol requires internal communication between the client and server that is controlled by the XPA interface itself. Authentication is an example of this sort of communication, as is the establishment of a data channel between the two processes πŸ”₯. The default value for the short is 30 seconds (which is a pretty long time, actually). Setting the value to -1 will disable short timeouts and allow an infinite amount of time ⭐.

  • XPA_SIGUSR1 β€” if the value of this variable is true, then XPA will catch SIGUSR1 signals when performing an I/O operation in order to curtail that operation πŸ’–. This facility allows users to send a SIGUSR1 signal to an XPA server if a client is hanging up the server by sending or receiving data too slowly (timeouts also can be used -- see above). When enabled in this way, the SIGUSR1 signal is ignored at all other times, so that its safe to send the signal at any time 🧚. If the variable is set to false, then SIGUSR1 is not used at all. Turning off SIGUSR1 would be desired in cases there the program uses SIGUSR1 for some other reason and does not want XPA interfering πŸ™ˆ. The default is to use the signal.
  • XPA_TIMESTAMP_ERRORS β€” if XPA_TIMESTAMP_ERRORS is true, then error messages will include a date/time string 🌸. This can be useful when XPA errors are being saved in an error log (e.g. Web/CGI use). The default is false.
  • XPA_TMPDIR β€” this variable specifies the directory into which XPA logs, Unix socket files (when XPA_METHOD is local), etc. are stored πŸ’œ. The default is /tmp/.xpa.
  • XPA_VERBOSITY β€” specify the verbosity level of error messages πŸ“£. If the value is set to 0, false, or off, then no error messages are printed to stderr. If the value is 1, then important XPA error messages will be output. If the value is set to 2, XPA warnings about out-of-sync messages will also be output. These latter almost always can be ignored 😌.
  • XPA_VERSIONCHECK β€” specify whether a new access point should check its major and minor XPA version number against the version used by the xpans name server at registration time πŸ‘€. The default is true. When checking is performed, a warning is issued if the server major version is found to be greater than the xpans version. Note that the check is performed both by the XPA server and by the xpans process and warnings will be issued by each. Also, instead of the values of true or false, you can give this variable an integer value n. In this case, each version checking process (i.e., the XPA-enabled server or xpans) will print out a maximum of n warning messages (after which version warnings are silently swallowed) 🀐.

In general, it is a bad idea to run an XPA-enabled server program using a version of XPA newer than the basic xpaset, xpaget, xpaaccess, xpans programs πŸ’€. This sort of mismatch usually will not work due to protocol changes.


🌈 SEE ALSO 🌈

See xpa(n) for a list of XPA help pages πŸ’–


and that's the whole vibe check bestie, you ate πŸ’…βœ¨ β€” this was version 2.1.15 of the page, dated July 23, 2013, filed under xpaenv(7). mwah πŸŽ€πŸ¦‹πŸ’œ