Startup script

SpectX 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/ 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


The startup script spectx\bin\spectx.bat takes the following command-line arguments:

-h,--help          Show this help and exit
-V,--version       Show version information and exit
-L,--license       Show license information and exit. With -v prints 3rd party licenses
-v,--verbose       Make logging verbose, use multiple times to increase verbosity level
-q,--quiet         Disable logging to standard output
-t,--testconfig    Test configuration and exit
-r,--reconfigure   Prompt for new configuration values, save them to config file and exit

Unless it is invoked without -h, -L and -V switches it starts the SpectX server in the foreground.

Environment Variables

The following environment variables can be set in include script spectx/bin/ (spectx\bin\spectx.env.bat on Windows) which 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.