FastX Startup Options


Attention: This article for FastX 3.3.

FastX can be configured to set files and directories in locations other than the default location.  This is useful for administrators who want to install FastX in a central location for multiple systems, and for users who wish to install FastX on a Docker image.  Administrators should keep the following rules in mind

  • Each system needs its own var, config, and local dir
  • A TEMP directory must have read/write permissions for all users
  • Users are defined by their username (not uid)
  • In a cluster, users should have a mounted $HOME directory

FastX.conf

The FastX.conf file is a special file that is located in $FX_CONFIG_DIR. This file sets special variables for launching sessions.  These are the default paths where the session will store session information.

# HOST is set to $(hostname) by default.
FastXPath=@HOME@/.fastx_server   #base directory for FastX user storage
SessionPath=@HOME@/.fastx_server/@HOST@/sessions # location of session directories

Variable expansion is done by enclosing the variable name in “@” (@VAR@). To put a literal “@” in a variable, use “@@”. A “#” makes the rest of the line a comment. To put a literal “#” in a variable, use “@#@”. A variable can be either a FastX.conf variable or an environment variable. Available variables are HOST, which is set to the hostname of this server; USER, which is the username. HOME is a useful environment variable.

SessionPath is where session directories are stored. A session directory is named “FX3-” followed by the session id. The session directory contains log files, the X11 authorization file, session parameters, process ids, and other session-specific files.

FastXPath is where the history, bookmarks, and favorites file are kept, although the FastX database may have a more updated version of the information in these files. If this directory cannot be created, then the history is not saved.

HOST can be set if the system hostname command does not return a valid DNS hostname. It is used in the history file, to make an X11 authorization entry, and to set the DISPLAY name.

Environment Variables

FX_VAR_DIR

Default: /var/fastx

Directory for Configuration, database, licenses, and local files.  The var directory contains files that are specific to this installation of FastX. This includes configuration files (see FastX config Directory below), the local directory (see below), web (SSL) certificates, license files, and local web files (if used).

FX_CONFIG_DIR

Default: /etc/fastx

This is the directory of all configuration that is local to the system.  You can mount this directory to be used by multiple systems, but that means changes that should be local to one system would propagate to others.  A better idea is to clone a base configuration to the other systems’ config dirs.  

The config directory is read by the fastx-protocol and session start scripts, and the FastX web server.

FX_LOCAL_DIR

Default: $FX_VAR_DIR/local

The local directory contains the FastX database, the server ID, and the public-private key for this FastX server. This directory must be unique (not shared) for each FastX server (including FastX cluster members)

Setting Environment Variables

When FastX is installed as a service, you can set environment variables in /etc/sysconfig/fastx3

Variables are set using the syntax “NAME=value”.

Hostname Substitution

Users may wish to create unique directory names by including the system host name. This can be done in the /etc/sysconfig/fastx3 file with a substitution that depends on the type of system.

Systemd Systems

Systemd is installed on most modern linux systems (Red Hat 7 or later)

Use “%H” to substitute the host name. 

Init.d Systems

Older systems use init.d

Use $HOST. To determine if your system is using systemd, run the command systemctl. If it shows many units loaded, then your system is a systemd system. If the systemctl command is not found, or shows nothing, then your system is the older init.d type.

Example

On a RedHat 7 system with systemd support suppose FastX is installed in /opt/sw/fx
You wish to configure your FX_LOCAL_DIR as  /opt/sw/fx/var/local/`hostname`/

  1. Make a local copy of the fastx3 service file:
    cp /usr/lib/systemd/system/fastx3.service /etc/systemd/system/
  2. Edit the new service file (/etc/systemd/system/fastx3.service) to add this line:
    Environment=FX_LOCAL_DIR=/opt/sw/fx/var/local/%H
  3. Reload systemd:
    systemctl daemon-reload
  4. Re-enable the fastx3 service:
    systemctl disable fastx3; systemctl enable fastx3
  5. Restart the fastx3 service:
    systemctl stop fastx3; systemctl start fastx3