Startup script

SpectX Server startup script is aimed to provide easy way to manage SpectX server process. Its functionality, though, varies on different platforms.

Linux and Mac OSX

The startup script spectx/bin/spectx.sh for Linux, Arch Linux ARM, and MacOSX takes the following command-line arguments:

  • start - to start server process in the background
  • stop - to stop running server process
  • restart - to stop and start server process in the background
  • status - to check if the server process is running
  • configtest - to check if current configuration file syntax is valid. Prints current config content to stdout and exits.
  • configure - to call first-run configuration wizard. Asks for configuration parameters, saves the configuration and exists.
  • enable-boot-start [username] - to launch SpectX as a service. You may specify username for an account the service will be launched under, if it differs from the current one.
  • disable-boot-start - removes SpectX service and stops corresponding process.

The last two modes are available only on Linux and Arch Linux ARM. For these, exit code 0 also indicates success, and the meaning of any other value can be figured out by consulting documentation of the init manager present in the system.

For the first five modes, an exit value 0 indicates successful operation, any other value indicates one of the following errors:

1 incorrect script arguments
2 pid file not found, assuming server process is not running
3 server process failed starting
4 server process is dead but pid file exists
5 java executable cannot be found
6 pid file cannot be written
7 server process stopped but pid file cannot be deleted
8 jar cannot be found or is not readable
9 conf file cannot be found or is not readable
10 log dir cannot be found or is not writable
127 error in processing file paths

Windows

The service launcher spectx\bin\spectx.exe takes the following command-line arguments:

  • run [arguments] - to run the SpectX program with given arguments without detaching from terminal
  • install [account] - to install the SpectX service to be run under specified builtin account or existing managed service account
  • uninstall - to uninstall the SpectX service. The service gets stopped first
  • start - to start already installed SpectX service
  • status - to get the status of the SpectX service
  • stop - to stop running SpectX service
  • setup - to install and start the SpectX service under virtual account “NT SERVICE\SpectX”

Make sure to start the launcher in Command Prompt with elevated privileges for performing service management tasks like install, uninstall, start, stop, setup. The install action adds full control privileges for the specified account to ${SPECTX_HOME} directory.

The service launcher uses an include script for initializing environment for SpectX.

Environment Variables

The following environment variables can be set in include script spectx/bin/spectx.env.sh on Linux, Arch Linux ARM and MacOSX. This script gets invoked by startup script:

  • SPECTX_HOME - specifies absolute path to SpectX installation directory (spectx/). The system user who starts the SpectX server must have read and write permissions in this directory. If it is not set explicitly, the startup script sets it to a value of the absolute path of a parent of its parent directory.

  • JAVA_HOME - specifies the path to JRE/JDK 1.8 home directory. If not set the packaged JRE is used (from the spectx/jre/ directory).

  • JAVA_OPTS - specifies list of values for named system properties for the SpectX Java process, each of the form -D<name>=<value>. These properties can be used for system proxy configuration.

  • SPECTX_LAUNCHER_ARGS - command line arguments for the SpectX server java process invoked by startup script on Linux, Arch Linux ARM and Mac OSX. You may add -v[v[v]] to increase logging verbosity level.

  • SPECTX_STD_LOG_DIR - specifies absolute path to a directory for stdout and stderr log files produced by startup script on Linux, Arch Linux ARM and Mac OSX.

System properties

There are no mandatory system properties. The following system properties are set by default in system properties file spectx\bin\spectx.exe.vmoptions used by service launcher on Windows:

  • SPECTX_HOME - specifies absolute path to SpectX installation directory (spectx/). The system user who starts the SpectX server must have read and write permissions in this directory. If it is not set explicitly, the launcher sets it to a value of the absolute path of a parent of its parent directory.

  • SPECTX_LOG_DIR - the value of this property is used in default configuration file for specifying log directory.

The properties must be specified in the file in the form -D<name>=<value>, one on each line. The lines starting with # are treated as comment lines.