Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Start Script: agent.sh, agent.cmd

Usage

The JS7 Agent includes a Start Script to manage the Agent:

  • The default location of the agent.sh|cmd Start Script is:
    • /opt/sos-berlin.com/js7/agent/bin for Unix and

    • C:\Program Files\sos-berlin.com\js7\agent\bin for Windows.

Running the Agent Start Script without parameters displays the usage clause:

...

The JS7 Agent Instance Start Script includes a number of environment variables that can be used to specify startup parameters. The Agent Instance Start Script finally calls the Agent Start Script.

It is recommended to create an individual Instance Start Script from a template file as this allows to specify individual startup parameters by use of environment variables. 

  • The default location of the agent_<port>instance.sh|cmd file -example|cmd-example Instance Start Script template is:
    • /opt/sos-berlin.com/js7/agent/bin on Unix systems and

    • C:\Program Files\sos-berlin.com\js7\agent\bin on Windows.

Environment Variables

  • It is recommended to copy the template file to a new Instance Start Script file with the name agent_<port>.sh|cmd with <port> being the HTTP port used by the Agent (see below).
    • If the Agent installation was performed for Windows by use of the installer, either in headless mode or in graphical mode, then the installer automatically created this script.
    • If the Agent installation was performed by extracting a .tar.gz/.zip archive then the Instance Start Script has to be created from a copy of the template file.
    • With the Instance Start Script being copied you can adjust startup parameters from environment variables, see below.

Environment Variables

The following environment variables can be used in the Instance Start Script scriptThe following environment variables can be used:

  • JS7_AGENT_HOME
    • Points to the directory where the JS7 Agent has been installed.
    • Without setting this environment variable the default value is the parent directory of the Agent Start Script.
    • Should you want to start the Agent from a directory different from the Agent installation directory, e.g. by copying the Start Script to some other location, then this environment variable has to be set in order to locate the JS7 Agent installation directory.
  • JS7_AGENT_USER
    • Sets the user account that the Agent is operated for. This includes running jobs with the permissions of the specified user account.
    • This setting is available for Unix systems only. For Windows systems, the user account that runs the Windows Service is used.
    • Without setting this environment variable the user account that runs the Start Script is used.
    • This setting can be used when running the Agent Start Script on system startup and shutdown configurations that are executed by root, e.g. in /etc/init.d and corresponding locations or with systemd.
  • JS7_AGENT_HTTP_PORT
    • Sets the HTTP port that the Agent is listening to.
    • Indicates which network interfaces the Agent should listen to if a hostname or IP address is specified as e.g. with JS7_AGENT_HTTP_PORT=myHost:4444.
    • If only a port number is specified then the Agent listens to all available network interfaces via HTTP.
    • Without setting this environment variable the port defaults to 4445.
  • JS7_AGENT_HTTPS_PORT
    • Sets the HTTPS port that the Agent is listening to.
    • Indicates which network interfaces the Agent should listen to if a hostname or IP address is specified as e.g. with JS7_AGENT_HTTPS_PORT=myHost:4443.
    • If only a port number is specified then the Agent listens to all available network interfaces via HTTPS.
    • When using the HTTPS protocol for connections from a Controller consider to allow the HTTP protocol in addition for local connections as with JS7_AGENT_HTTP_PORT=localhost:4445. As the Agent Start Script makes use of an HTTP connection this protocol has to be in place to allow the Agent instance to be started, stopped etc. by its Start Script.
    • Without setting this environment variable the HTTPS protocol is not used.
  • JS7_AGENT_DATA
    • Points to the location where the Agent finds its configuration data, log data and journals.
    • Without setting this environment variable the default value is JS7_AGENT_HOME/var_<JS7_AGENT_HTTP_PORT>.
  • JS7_AGENT_CONFIG_DIR
    • Points to the directory where the Agent finds its configuration data.
    • Without setting this environment variable the default value is JS7_AGENT_DATA/config.
  • JS7_AGENT_LOG_DIR
    • Specifies the directory where the Agent log files are created.
    • This setting defaults to the sub-directory logs in the JS7_AGENT_DATA directory.
  • JS7_AGENT_PID_FILE_DIR
    • Specifies the directory where the Agent PID file is created.
    • This setting defaults to the directory that is specified with the JS7_AGENT_LOG_DIR environment variable or the log directory default value.
  • JS7_AGENT_WORK_DIR
    • Specifies the working directory for the jobs started by the Agent, e.g. ${HOME} or %USERPROFILE%.
    • This setting defaults to JS7_AGENT_HOME.
  • JS7_AGENT_KILL_SCRIPT
    • Specifies the location of a "kill script" if an individual script is required.
    • The kill script provides the functionality to kill a task and any child processes of a job.

    • Kill scripts are by default provided from the following locations:
      • JS7_AGENT_DATA/tmp/kill_task.sh for Unix.

      • JS7_AGENT_DATA\tmp\kill_task.cmd for Windows.

  • JAVA_HOME
    • Points to the location of the Java Runtime Environment (JRE).
    • Without setting this environment variable Java will be used from the location specified by the system path.
    • Please consider that JAVA_HOME does not point to the location of a JDK but to a JRE directory where the bin/java executable resides, for example if the location of the Java executable is /opt/java/jdk8u202-b08/jre/bin/java then JAVA_HOME=/opt/java/jdk8u202-b08/jre.
  • JAVA_OPTIONS
    • Sets Java options, e.g. the Java memory settings for the Agent.
    • Without setting this environment variable the Java options default to '-Xms100m'.
  • JS7_AGENT_JOB_JAVA_OPTIONS
    • Sets Java options for each JITL job and JVM job that is started by the Agent.

...