Starting Sessions From the Command Line

No matter how a session is started, the final operation is running a script from the command line.  Users can run the start script directly to start a session using the following command

/usr/lib/fastx/4/scripts/start --command COMMAND --geometry GEOMETRY --name NAME --param PARAM1=VALUE1 --param PARAM2=VALUE2 …

Admins who wish to integrate load balancers into their systems should especially get accustomed to this command.  Their job scheduling script will eventually run this command.

Command Line Parameters

  • --command (required): This is run after the DISPLAY has been started. It is typically the command that defines the session. For example, “xterm -ls” or “gnome-session”. If this is a desktop session, the session will be terminated when the command exits. If this is a rootless session, the session will be terminated when all windows are closed. This allows commands that exit but continue to run in the background, such as gnome-terminal, to keep the session running.
  • --geometry : For a desktop session, this specifies the initial geometry of the session’s root window. The geometry may be changed when a FastX client connects. If this is a rootless session, this parameter must be “rootless”.
  • --name : The name of the session, as seen in the session browser. This is a shortcut for “–param name=” as the name is a session parameter.
  • --param : Session parameters are key/value pairs assigned to the session. They can be changed or deleted while a session is running. They are mainly used for information, but 3rd party applications can use them to associate them with batch system, for example.
  • --cli (boolean) : If this is specified (it doesn’t take a value), it puts start in command-line mode. Usually, start will return the session information as a JSON object and exit, but if –cli is specified, the start script will remain running in the foreground until the session exits. When running in command-line mode, output, errors, and exit code are passed from the session command.
  • --id : While not recommended, it is possible to assign a session-ID using this parameter. Unusually, the session-ID is randomly generated and returned when the session is started.
  • –-json : All of the parameters above, and more, can be specified in one JSON object.