Page History
...
--http-port=<[hostname or ip address:]number>
- specifies Specifies the HTTP port that the Agent is listening to in order to receive requests from a JS7 Controller:
agent.sh|cmd |sh --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 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 a port then the following precedence applies:
- First precedence: command line option
- Second precedence: environment variable
JS7_AGENT_HTTP_PORT
(see below) - Third precedence: use of default value
- specifies Specifies the HTTP port that the Agent is listening to in order to receive requests from a JS7 Controller:
--https-port=<[hostname or ip address:]number>
- specifies Specifies the HTTPS port that the Agent is listening to in order to receive requests from a Controller:
agent.sh|cmd |sh command --https-port=####
- where
####
is the numeric port. - This option can be also used to indicate which network interfaces the Agent should listen to if in addition you specify a hostname or IP address for example with
--https-port=myhost:4445
.
- When using the HTTPS protocol for connections from a Controller instance consider to allow the HTTP protocol in addition 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 Without this option being used the port defaults to 4445 and the Agent listens to all available network interfaces. - Should you want to specify a port then the following precedence applies:
- First precedence: command line option
- Second precedence: environment variable
SJS7_AGENT_HTTPS_PORT
(see below) - Third precedence: use of default value
- specifies Specifies the HTTPS port that the Agent is listening to in order to receive requests from a Controller:
--data-directory=<location of data directory>
- specifies Specifies the location of the data directory that usually includes the
config
,logs, tmp
andstate
directories. - This location has to be unique for any Agent instances
- Should you want to specify a data directory then the following precedence 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>
)
- specifies Specifies the location of the data directory that usually includes the
--config-directory=<location of config directory>
- specifies Specifies the location of the
config
directory for configuration data. - This location has to be unique for any Agent instances.
- Should you want to specify a config directory configuration directory then the following precedence applies:
- First precedence: command line option
- Second precedence: environment variable
JS7_AGENT_CONFIG_DIR
(see below) - Third precedence: use of default value (=value
JS7_AGENT_HOME/var_<JS7_AGENT_PORT>
)
- specifies Specifies the location of the
--sigkill
With the
stop
andrestart
commands this option kills any running processes of a job 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/tmp/kill_task.sh
for Unix.JS7_AGENT_DATA\tmp\kill_task.cmd
for Windows.
This option can be used to specify the location of an individual "kill script" if required.
Should you want to specify an individual "kill script" then the following precedence 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>
With Java 1.8 the initial memory allocation has changed, for details see How to manage the Java heap space.
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'.
Should you want to specify the Java options then the following 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>
Without this option being used the Java options for each job which is started by the Agent.
Should you want to specify the Java options for execution of JITL jobs and JVM jobs then the following precedence applies:
- First precedence: command line option
- Second precedence: environment variable
JS7_AGENT_JOB_JAVA_OPTIONS
(see below)
...
- The default location of the
agent
_<port>.cmdsh|sh cmd
file is:/opt/sos-berlin.com/js7/agent/bin
on Linux Unix systems andC:\Program Files\sos-berlin.com\js7\agent\bin
on Windows.
...
The following environment variables can be used:
JAVAJS7_AGENT_HOME
- points Points to the location of the Java Runtime Environment (JRE)directory where the JS7 Agent has been installed.
- 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 thebin/java
executable resides.
JAVA_OPTIONS
- 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
- 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 job that is started by the Agent.
JS7_AGENT_HOME
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 usedpoints 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 directoryuser 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. 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 directoryin/etc/init.d
and corresponding locations or withsystemd
.
JS7_AGENT_HTTP_DATAPORT
- points to the location where the Agent finds its data directory.
- 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 Without setting this environment variable the default value is
JS7_AGENT_HOME/var_<JS7_AGENT_HTTP_PORT>
.
JS7_AGENT_CONFIG_DIR
HTTP_PORT=myHost:4444
.- If only a port number is specified then the Agent listens to all available network interfaces via HTTP
- points to the directory where the Agent finds its configuration.
- Without setting this environment variable the default value is
JS7_AGENT_DATA/config
port defaults to4445
.
JS7_AGENT_HTTPHTTPS_PORT
- sets Sets the HTTP HTTPS port that the Agent is listening to.
- indicates 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 if only a port number is specified then the Agent listens to all available network interfaces via HTTPHTTPS.
- Without setting this environment variable the port defaults to
4445
. - 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
- 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.
- if only a port number is specified then the Agent listens to all available network interfaces via HTTPS
=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_USERDATA
- 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 usedPoints to the location where the Agent finds its configuration data, log data and journals.
- 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 withsystemd
.default value isJS7_AGENT_HOME/var_<JS7_AGENT_HTTP_PORT>
.
JS7_AGENT_LOGCONFIG_DIR
- sets Points to the directory where the Agent log file is createdfinds its configuration data.
- This setting defaults to the sub-directory
logs
in the Without setting this environment variable the default value isJS7_AGENT_DATA
directory/config
.
JS7_AGENT_WORKLOG_DIR
- sets Specifies the working directory for the jobs started by where the Agent , e.g.
${HOME}
or%USERPROFILE%
.log files are created. - This setting defaults to the sub-directory
logs
in theJS7_AGENT_HOMEDATA
directory.
- sets Specifies the working directory for the jobs started by where the Agent , e.g.
JS7_AGENT_PID_KILLFILE_SCRIPTDIR
- sets 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.
- 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 valueKill scripts are by default provided from the following locations:JS7_AGENT_DATA/tmp/kill_task.sh
for Unix.
JS7_AGENT_
DATA\tmp\kill_task.cmdWORK_DIR
- Specifies the working directory for the jobs started by the Agent, e.g.
${HOME}
or%USERPROFILE%
JS7_AGENT_PID_FILE_DIR
- sets 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.
- Specifies the working directory for the jobs started by the Agent, e.g.
Running the Agent
- SOS does not recommend to run the JS7 Agent as
root
(for Unix) or asAdministrator
(for Windows).- In fact the Agent can be operated with administrative privileges which leverages to switch 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 Windows the JS7 Agent can switch to a different user account in a compliant way, see JobScheduler Universal Agent - Running jobs as a different user.
- For Unix use of
sudo
is recommended.
Starting the Agent
Code Block | ||
---|---|---|
| ||
agent.cmd|sh start [options] |
Stopping the Agent
Code Block | ||
---|---|---|
| ||
agent.cmd|sh stop [options] |
This command will safely terminate the Agent (recommended).
- The Agent waits for running processes of any jobs to be completed.
- Using the
--sigkill
command line option will terminate the Agent normally and will kill any running processes.
Code Block | ||
---|---|---|
| ||
agent.cmd|sh abort [options] |
The Agent process is immediately aborted.
- Any running tasks and child processes of jobs are killed immediately with a SIGKILL signal.
- Should tasks use resources such as database connections then they will not be properly closed.
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 thebin/java
executable resides, for example if the location of the Java executable is/opt/java/jdk8u202-b08/jre/bin/java
thenJAVA_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.
Running the Agent
- SOS does not recommend to run the JS7 Agent as
root
(for Unix) or asAdministrator
(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 Windows the JS7 Agent can switch to a different user account in a compliant way, see JobScheduler Universal Agent - Running jobs as a different user.
- For Unix use of
sudo
is recommended.
Starting the Agent
Code Block | ||
---|---|---|
| ||
agent.sh|cmd|sh killstart [options] |
The Agent process is killed.
- This corresponds to sending SIGKILL with a kill command.
- Should jobs be running that started detached child processes then it is not guaranteed that child processes will be killed.
Restarting the Agent
Stopping the Agent
Code Block | ||
---|---|---|
Code Block | ||
| ||
agent.sh|cmd|sh restartstop [options] |
This command will safely restart terminate the Agent (recommended).
- The Agent waits for running processes of any jobs to be completed.
- Using the
--sigkill
command line option will terminate the Agent normally , and will kill any running processes and restart the Agent.
...
Code Block | ||
---|---|---|
| ||
agent.sh|cmd|sh statusabort [options] |
...
The Agent process is immediately aborted.
- Any running tasks and child processes of jobs are killed immediately with a SIGKILL signal.
- Should tasks use resources such as database connections then they will not be properly closed.
Code Block | ||
---|---|---|
| ||
agent.sh|cmd kill [options] |
The Agent process is killed.
- This corresponds to sending SIGKILL with a kill command.
- Should jobs be running that start detached child processes then it is not guaranteed that child processes will be killed.
Restarting the Agent
Code Block | ||
---|---|---|
| ||
agent.sh|cmd restart [options] |
This command will safely restart the Agent (recommended).
- The Agent waits for running processes of any jobs to be completed.
- Using the
--sigkill
command line option will terminate the Agent normally, kill any running processes and restart the Agent.
Checking the Agent Status
Code Block | ||
---|---|---|
| ||
agent.sh|cmd status [options] |
Should the Agent be up and running then this command will result in output such as:
Code Block | ||
---|---|---|
| ||
version: 2.0.0-alpha.20210722.2 (2021-07-22) buildId: QQqWYNiJRbqcYqx4iiFWww startedAt: 1626981330629 isTerminating: false system: hostname: agent-2-0-primary distribution: Alpine Linux v3.13 cpuModel: Intel(R) Xeon(R) CPU E5-2630 v4 @ 2.20GHz mxBeans: operatingSystem: version: 2.0.0-alpha.20210722.2 (2021-07-22) buildId: QQqWYNiJRbqcYqx4iiFWww startedAt: 1626981330629 isTerminating: false system: hostname: agent-2-0-primary distribution: Alpine Linux v3.13 cpuModel: Intel(R) Xeon(R) CPU E5-2630 v4 @ 2.20GHz mxBeans: operatingSystem: availableProcessors: 8 systemLoadAverage: 0.0107421875 java: version: 1.8.0_292 memory: maximum: 954728448 total: 289931264 free: 87118936 systemProperties: java.vendor: IcedTea os.arch: amd64 java.runtime.name: OpenJDK Runtime Environment os.version: 3.10.0-957.1.3.el7.x86_64 os.name: Linux java.vm.name: OpenJDK 64-Bit Server VM java.version: 1.8.0_292 |
Windows Service Interface
The following information applies to headless installation for Windows systems. For installation with a GUI and user dialog see JS7 - Agent - Use of Windows Graphical Installer.
The Agent is operable as a Windows Service. The start script of the Agent allows to install/remove the Windows Service.
...
os.version: 3.10.0-957.1.3.el7.x86_64
os.name: Linux
java.vm.name: OpenJDK 64-Bit Server VM
java.version: 1.8.0_292 |
Windows Service Interface
The following information applies to headless installation for Windows systems. For installation with a GUI and user dialog see JS7 - Agent - Use of Windows Graphical Installer.
The Agent is operable as a Windows Service. The start script of the Agent allows to install/remove the Windows Service.
Installing the Windows Service
Code Block | ||
---|---|---|
| ||
agent.cmd install-service [--http-port=<number>] |
This command installs the Agent's Windows Service. After the installation, you 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.
Warning |
---|
During service installation, the installer tries to copy the executable file for the Windows Service to the |
Starting the Windows Service
Code Block | ||
---|---|---|
| ||
agent.cmd start-service [--http-port=<number>] |
This command starts the Windows Service with the name SOS JS7 Agent -port=<number>.
Info |
---|
The |
Removing the Windows Service
Code Block | ||
---|---|---|
| ||
agent.cmd installremove-service [--http-port=<number>] |
This command installs removes the Agent's Windows Service. After the installation, you executing this command you should not find the Windows Service with the name name SOS JS7 Agent -port=<number>
in the in the Services Manager Console . The Windows service uses the "local system" account.any longer.
Warning |
---|
During service installation, the installer removal of the service it tries to copy remove the executable file for of the Windows Service to from the |
...
above command once more. |
Configuring the Windows Service
After the installation of the Windows Service you will find the .\service\js7_agent_<http-port>w.exe
file. Start this program to configure the Windows Service.
Code Block | ||
---|---|---|
| ||
agent.cmd start-service [--http-port=<number>] |
This command starts the Windows Service with the name SOS JS7 Agent -port=<number>.
Info |
---|
The |
Removing the Windows Service
Code Block | ||
---|---|---|
| ||
agent.cmd remove-service [--http-port=<number>] |
This command removes the Windows Service. After executing this command you 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 tries to remove the executable file of the Windows Service from the |
Configuring the Windows Service
After the installation of the Windows Service you will find the .\service\js7_agent_<http-port>w.exe
file. Start this program to configure the Windows Service.
...
...
For example go to the "Startup" tab |
Debugging
- The Agent log level can be increased using the Agent's Apache ProcRun Demon Service Manager demon/service.
- For Windows systems this is installed in the Agent's
service
folder with a name such asjs7_agent_<port>w.exe
where<port>
is the Agent's HTTP port. - Start the ProcRun Manager, select the Logging tab in the Manager interface and set the level to Debug.
- The location of log files is explained above.
- Consider to revert a debug log level once you are finished with debugging.
Usage Examples
Running the Agent for Windows
For Windows® operating systems the location of the Java Runtime Environment and the log directory can be specified like this:
Code Block | ||
---|---|---|
| ||
set JAVA_HOME=%ProgramFiles%\Java\jre8
set JS7_AGENT_LOGS=%ProgramData%\sos-berlin.com\js7\agent\logs
"%ProgramFiles%\sos-berlin.com\js7\agent\bin\agent.cmd" start |
Running the Agent for Unix
For Unix the location of the Java Runtime Environment and the log directory can be specified like this:
Code Block | ||
---|---|---|
| ||
export JAVA_HOME="/opt/java/jdk8u202-b08/jre"
export JS7_AGENT_LOGS="/var/logs/agent"
/opt/sos-berlin.com/js7/agent/bin/agent.sh" start |