Versions Compared

Key

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

...

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

...

  • --http-port=<[hostname or ip address:]number>
    • Specifies the HTTP port that the Agent is listening to in order to receive requests from a JS7 Controller:
      • agent.sh|.cmd --http-port=####

      • where #### is the numeric port.
      • This option can be used to indicate which network interface the JS7 Agent should listen to if in addition you specify a hostname or IP address is specified, for example with --http-port=myhost:4445.
    • Without this option being used the port defaults to 4445 and the Agent listens to all available network interfaces.
    • Should you want to specify If a port is specified then the following precedence order applies:
      • First precedence: command line option
      • Second precedence: environment variable JS7_AGENT_HTTP_PORT (see below)
      • Third precedence: use of default value
  • --https-port=<[hostname or ip address:]number>
    • Specifies the HTTPS port that the Agent is listening to in order to receive requests from a Controller:
      • agent.sh|.cmd command --https-port=####

      • where #### is the numeric port.
      • This option can be used to indicate which network interfaces the Agent should listen to if in addition you specify a hostname or IP address for address is specified, for example with --https-port=myhost:4445.
    • When using the HTTPS protocol for connections from a Controller instance consider additionally allowing the HTTP protocol for local connections as with --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 to be started, stopped, etc. by its Start Script.
    • Without this option being used the port defaults to 4445 and the Agent listens to all available network interfaces.
    • Should you want to specify If a port is specified then the following precedence order applies:
      • First precedence: command line option
      • Second precedence: environment variable SJS7_AGENT_HTTPS_PORT (see below)
      • Third precedence: use of default value
  • --data-directory=<location of data directory>
    • Specifies the location of the data directory that usually includes the config, logs, tmp and state directories.
    • This location has to be unique for any Agent instancesinstance.
    • If Should you want to specify a data directory is specified then the following precedence order applies:
      • First precedence: command line option
      • Second precedence: environment variable JS7_AGENT_DATA (see below)
      • Third precedence: use of default value JS7_AGENT_HOME/var_<JS7_AGENT_PORT>
  • --config-directory=<location of config directory>
    • Specifies the location of the config directory for configuration data.
    • This location has to be unique for any Agent instancesinstance.
    • Should you want to specify a configuration directory be specified then the following precedence order applies:
      • First precedence: command line option
      • Second precedence: environment variable JS7_AGENT_CONFIG_DIR (see below)
      • Third precedence: use of default value JS7_AGENT_HOME/var_<JS7_AGENT_PORT>
  • --sigkill
    • With the stop and restart commands this option kills any running processes of jobs by use of a SIGKILL signal.

  • --kill-script=<location of kill script>
    • The kill script provides the functionality to kill tasks and any child processes of jobs.

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

      • JS7_AGENT_DATA\work\kill_task.cmd for Windows.

    • This option can be used to specify the location of an individual "kill script" if  if required.

    • Should you want to specify an an individual "kill script"  be specified then the following precedence order applies:

      • First precedence: command line option
      • Second precedence: environment variable JS7_AGENT_KILL_SCRIPT (see below)
      • Third precedence: use of default value
  • --java-options=<java options>
    • This option can be used to apply Java options for the Agent, e.g. for memory settings.

    • Without this option being used the Java options default to -Xms100m.

    • In order to specify a number of Java options use quotes have to be used like this:
      • --java-options="-Xms100m -Xmx1g"
    • When specifying Java options then the following precedence order of precedence applies:

      • First precedence: command line option
      • Second precedence: environment variable JAVA_OPTIONS (see below)
      • Third precedence: use of default value
  • --job-java-options=<java options>
    • This option can be used to specify Java options for Shell jobs that load a JVM. This option does not apply to jobs derived from JS7 - Job Templates that are executed in the Agent's JVM.
    • In order to specify a number of Java options use quotes have to be used like this:
      • --job-java-options="-Xms100m -Xmx1g"
    • When specifying Java options for execution with Shell jobs then the following precedence order of precedence applies:

      • First precedence: command line option
      • Second precedence: environment variable JS7_AGENT_JOB_JAVA_OPTIONS (see below)

...

The JS7 Agent includes a template file for an Instance Start Script that can be adjusted to specify startup start-up parameters.

  • The Instance Start Script sets a number of environment variables and finally executes the Start Script.
  • In the Instance Start Script you can adjust startup parameters start-up parameters can be specified from environment variables, see below.

...

  • The default location of the Instance Start Script template file is:
    • /opt/sos-berlin.com/js7/agent/bin/agent_instance.sh-example on Unix systems and

    • C:\Program Files\sos-berlin.com\js7\agent\bin\agent_instance.cmd-example on Windows.
  • Create Users can create a copy of the template file and remove the -example extension from the file name. The renamed Instance Start Script will not be overwritten when updating the Agent later on.
  • It is recommended to copy the template file to a an 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 is performed on Windows by use of the installer, either in headless mode or in graphical mode, then the installer automatically creates the script.
    • If the Agent installation was is 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 users can adjust startup start-up parameters from environment variables, see below.

...

  • 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 be started from a directory other than the Agent installation directory, e.g. for example 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.
    • There is no corresponding command line option.
  • JS7_AGENT_USER
    • Sets the user account that the Agent is operated for. This includes running to run 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 start-up and shutdown configurations that are executed by root, e.g. for example in /etc/init.d and corresponding locations or with systemd.
    • There is no corresponding command line option.
  • 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. , for example with JS7_AGENT_HTTP_PORT=myHost:4444.
    • If only a port number only is specified then the Agent listens to all available network interfaces via HTTP.
    • Without setting this environment variable the port defaults to 4445.
    • Corresponding command line option: --http-port
  • 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. , for example with JS7_AGENT_HTTPS_PORT=myHost:4443.
    • If only a port number only is specified then the Agent listens to all available network interfaces via HTTPS.
    • When using the HTTPS protocol for connections from a Controller users should consider additionally allowing to allow the HTTP protocol 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.
    • Corresponding command line option: --https-port
  • 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>.
    • Corresponding command line option: --data-directory
  • 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.
    • Corresponding command line option: --config-directory
  • 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.
    • There is no corresponding command line option.
  • 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.
    • There is no corresponding command line option.
  • 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_HOMEDATA.
    • There is no corresponding command line option.
  • JS7_AGENT_KILL_SCRIPT
    • Specifies the location of a "kill script" if  if an individual script is required.
    • The kill script allows to kill the task and any child processes of a job to be killed.

    • 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.

    • Corresponding command line option: --kill-script
  • JAVA_HOME
    • Points to the location of the JVM, either a JRE (Java Runtime Environment (JRE) or JDK (Java Development Kit).
    • Without setting this environment variable Java will be used from the location specified by the system path.
    • Please consider that The JAVA_HOME environment variable does not necessarily 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.
    • There is no corresponding command line option.
  • 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'.
    • Corresponding command line option: --java-options
  • JS7_AGENT_JOB_JAVA_OPTIONS
    • Sets Java options for each JITL job and JVM job that is started by the Agentshell jobs that start a JVM.
    • Corresponding command line option: --job-java-options

...

In addition to Agent Environment Variables users can add individual environment variables can be added. Such environment variables can be are made available for jobs .like this:

Code Block
languagebash
titleUsage on Unix
SCRIPT_PATH=/var/scripts
export SCRIPT_PATH

...

  • SOS does not recommend to run the JS7 Agent as the root  account (for Unix) or as as the Administrator  account (for Windows).
    • In fact the Agent can be operated with administrative privileges which leverages switching to any user account without specifying a password if jobs should be executed for a different user account.
    • However, in compliance-aware environments this is considered an unwanted risk and in any other environments this simply is a bad idea.
  • For Unix use of sudo is recommended.
  • For Windows the JS7 Agent can switch to a different user account in a compliant way, see JS7 - Running jobs as a different user.For Unix use of sudo is recommended.

The examples listed below make use of an Instance Start Script agent_4445.sh|.cmd, which is created from the template file to run the Agent using port 4445.

...

Code Block
languagebash
agent_4445.sh|.cmd start [options]

Stopping the Agent

Code Block
languagebash
agent_4445.sh|.cmd stop [options]

This command will safely terminate the Agent (recommended).

...

Code Block
languagebash
agent_4445.sh|.cmd abort [options]

The Agent process is immediately aborted.

...

Code Block
languagebash
agent_4445.sh|.cmd kill [options]

The Agent process is killed.

...

Code Block
languagebash
agent_4445.sh|.cmd restart [options]

This command will safely restart the Agent (recommended).

...

Code Block
languagebash
agent_4445.sh|.cmd status [options]


If the Agent is up and running then this command results in output such as:

...

Code Block
languagebash
agent_4445.sh|.cmd cert [cert-options]

This command is used to generate an SSL certificate for client and server authentication. 

...

This command installs the Agent's Windows Service. After the installation, you will find users find the Windows Service with the name SOS JS7 Agent -port=<number> in the Services Manager Console. The Windows service uses the "local system" account account.

Warning

During service installation, the installer tries to copy the executable file for the Windows Service to the .\service directory. This operation could fail with the error "Access denied" if you have extracted the Agent to e.g. Chas been extracted for example to C:\Program Files. In this case you users can change the permissions of the .\service directory or open the command prompt with elevated administrator rights and execute the above command once again.

...

This command removes the Windows Service. After executing this command you users should not find the Windows Service with the name SOS JS7 Agent -port=<number> in the Services Manager Console any longer.

Warning

During removal of the service it the Agent Start Script tries to remove the executable file of the Windows Service from the .\service directory. This operation could fail with the error "Access denied" if you users have extracted the Agent to e.g. C:\Program Files. In this case you users can change the permissions of the .\service directory or open the command prompt with elevated administrator rights and execute the above command once more.

Configuring the Windows Service

After the installation of the Windows Service you will users find the .\service\js7_agent_<http-port>w.exe file. Start this This program can be executed to configure the Windows Service.

...

  • The Agent log level can be increased by using the Agent's Apache ProcRun Demon Daemon Service Manager demondaemon/service.
  • On Windows systems this is installed in the Agent's service folder with a name such as js7_agent_<port>w.exe  where <port> is the Agent's HTTP port.
  • Start Users can start the ProcRun Manager, select the Logging tab in the Manager user interface and set the log level to Debug
  • The location of log files is explained above. 
  • Consider reverting Users should consider to revert a debug log level to its original value once you they are finished with debugging.

...