Agent
...
Start-up
Start Script
...
Usage
Running the Agent start script without parameters shows the usage clause:
: agent.sh, agent.cmd
The JS7 Agent includes a Start Script for managing the Agent:
- The default location of the
Start Script is: - Use of the Start Script is authoritative to start Agents.
Usage
Running the Agent Start Script without arguments displays the usage clause:
Code Block |
---|
language | text |
---|
title | Usage for Unix |
---|
|
Usage: agent.sh |
Code Block |
---|
language | text |
---|
title | Usage for Unix |
---|
|
Usage: agent.sh command [options] [web servicesswitches]
command:
start [options]
start_docker -container [options]
stop stop [options]
abortrestart [options]
restartstatus [options]
statuscancel [options]
[web services switch-over [options]
killcert [cert-options]
options:
-http-port=<[hostname or ip address:]number> | to listen to a specific host name or ip address if it is specified; default port: 4445, see https://kb.sos-berlin.com/x/jLbAAw
options:
--http-port=<[interface:]port> | http network interface and port, default: 4445
--https-port=<[hostname or ip addressinterface:]number>port> |
| https network interface and port, default:
--data-directory=<location<directory> of data directory> | default: /var/sos-berlin.com/js7/agent/var_4445
--config-directory=<location of config directory><directory> | default: /var/sos-berlin.com/js7/agent/var_4445/config
-kill-sigkill-scriptdelay=<location<seconds> of kill script> | default: "./bin/agent_kill_task.sh"; only for startsend SIGTERM and delayed SIGKILL signal, default: 3
-java-optionstimeout=<java<seconds> options> | timeout for |terminating default: -Xms100m; see https://kb.sos-berlin.com/x/aIC9jobs on Agent stop
-job-java-options=<java options> | default: |
web services:
overview -Xms100m -Dfile.encoding=UTF-8; see https://kb.sos-berlin.com/x/uYo7B
switches:
-c | --curl | use curl instead of Java | default
task http client
see https://kb.sos-berlin.com/x/ZqrAAw for more information. |
Code Block |
---|
language | text |
---|
title | Usage for Windows |
---|
|
Usage: agent.cmd command [options] [switches]
command:
start [options]
stop [options]
restart | running Agent tasks
[options]
tunnel status [options]
cancel [options]
switch-over [options]
start-service [options]
| tunnels summaryinstall-service [options]
tunnel/remove-service [options]
cert [cert-options] | see https://kb.sos-berlin.com/x/jLbAAw
options:
--http-port=<[interface:]port> | listhttp ofnetwork tunnels
interface and port, default: command4445
--https-port=<[interface:]port> | https network interface and port, default:
--data-directory=<directory> | running command summarydefault: /var/sos-berlin.com/js7/agent/var_4445
command/--config-directory=<directory> | default: /var/sos-berlin.com/js7/agent/var_4445/config
--timeout=<seconds> | timeout for terminating jobs on Agent |stop
list of running commands (watching file_order_source) |
Code Block |
---|
language | text |
---|
title | Usage for Windows |
---|
|
Usage: agent.cmd command [options] [web services]
command:
start [options]
stop --java-options=<java options> | default: -Xms100m -Dfile.encoding=UTF-8; see https://kb.sos-berlin.com/x/uYo7B
switches:
-c | --curl [options]
abort | use curl [options]
instead of Java restart [options]
status [options] [web services]
kill [options]
install-service [options]
remove-service [options]
start-service [options]
options:
-http-port=<[hostname or ip address:]number> | to listen to a specific host name or ip address if it is specified; default port: 4445,
-https-port=<[hostname or ip address:]number> |
-data-directory=<location of data directory> | default: .\var_4445
-config-directory=<location of config directory> | default: .\var_4445\config
-kill-script=<location of kill script> | default: ".\bin\agent_kill_task.cmd"; only for start, debug
-java-options=<java options> | default: -Xms100m; see https://kb.sos-berlin.com/x/aIC9
-job-java-options=<java options> |
web services:
overview | default
task | running Agent tasks
tunnel | tunnels summary
tunnel/ | list of tunnels
command | running command summary
command/ | list of running commands (watching file_order_source) |
Command Line Options
-http-port=<[hostname or ip address:]number>
- is the HTTP port that the Agent is listening to in order to receive requests from a JobScheduler Master:
- 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
-https-port=<[hostname or ip address:]number>
- is the HTTPS port that the Agent is listening to in order to receive requests from a Controller:
- 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
-data-directory=<number>
- Location of the data directory.
- It has to be unique for all 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>
)
-kill-script=<location of kill script>
The kill script provides the functionality to kill a task and any child processes.
- Two kill script is provided from
This option can be used to specify the location of a different "kill script" if required.
Should you want to specify a different "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. the 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)
Environment Startup Script
Usage
Info |
---|
|
Why should a user use environment variables? Where are they located? File names for Windows/Linux |
Environment Variables
The following environment variables can be used:
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.
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 job that is started by the Agent.
JS7_AGENT_HOME
- points to the directory where the JobScheduler Agent has been installed.
- Without setting this environment variable the default value is the parent directory of the start script.
- Should you want to start the Agent from a directory different to 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 JobScheduler Agent installation directory.
JS7_AGENT_DATA
- points to the directory where the Agent finds its data directory.
- Without setting this environment variable the default value is
JS7_HOME/var_<JS7_HTTP_PORT>
.
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.
- 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.
- if only a port number is specified then the Agent listens to all available network interfaces via HTTPS.
- Without setting this environment variable the HTTPS protocol is not used.
JS7_AGENT_USER
- sets the user account that the Agent is operated for. This includes running jobs with the permissions of the specified user.
- This setting is available for Unix systems only. For Windows systems, the user account that runs the start script 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 in system start-up and shutdown configurations that are executed by
root
, e.g. in /etc/init.d
or corresponding locations.
JS7_AGENT_LOG_DIR
- sets the directory where the Agent log file is created.
- This setting defaults to the directory
logs
in the JS7_AGENT_DATA
directory.
JS7_AGENT_WORK_DIR
- sets 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
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.
Running the Agent
- SOS does not recommend running the JS7 Agent as
root
(for Unix) or as Administrator
(for Windows).
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 to be completed.
Code Block |
---|
|
agent.cmd|sh abort [options] |
The Agent process is terminated immediately.
- Any running tasks and child processes 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.cmd|sh kill [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
Code Block |
---|
|
agent.cmd|sh restart [options] |
Checking the Agent Status
Code Block |
---|
|
agent.cmd|sh status [options] |
Should the Agent be up and running then this command will result in some output such as:
Code Block |
---|
|
isTerminating: false
system:
hostname: agenthost
mxBeans:
operatingSystem:
processCpuLoad: 2.5630713121704744E-5
availableProcessors: 4
freePhysicalMemorySize: 311668736
systemCpuLoad: 0.046373903924522855
committedVirtualMemorySize: 4475301888
totalPhysicalMemorySize: 3155517440
java:
systemProperties:
java.vendor: Oracle Corporation
os.arch: amd64
os.version: 2.6.32-220.17.1.el6.x86_64
os.name: Linux
java.version: 1.8.0_31
version: 1.10.0-SNAPSHOT (6956c56a535d15fcf659f293c42d22dcf92e9e12 2015-07-15 21:23:24+02:00)
startedAt: '2015-07-17T08:38:30.516Z'
totalTaskCount: 21
currentTaskCount: 0 |
Windows Service Interface
http client
see https://kb.sos-berlin.com/x/ZqrAAw for more information. |
Command Line Options
--http-port
- Specifies the HTTP port that the Agent is listening to in order to receive requests from a JS7 Controller. This option can be used to indicate which network interface the JS7 Agent should listen to if 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. - If a port is specified then the following order of precedence applies:
- First precedence: command line option
- Second precedence: environment variable
JS7_AGENT_HTTP_PORT
(see below) - Third precedence: use of default value
--https-port
- Specifies the HTTPS port that the Agent is listening to in order to receive requests from a Controller. This option can be used to indicate which network interface the Agent should listen to if a hostname or IP 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 the 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. - If a port is specified then the following order of precedence applies:
- First precedence: command line option
- Second precedence: environment variable
SJS7_AGENT_HTTPS_PORT
(see below) - Third precedence: use of default value
--data-directory
- Specifies the location of the data directory that usually includes the
config
, logs, tmp
and state
sub-directories. - This location has to be unique for any Agent instance.
- If a data directory is specified then the following order of 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>
--config-directory
- Specifies the location of the
config
directory for configuration data. - This location has to be unique for any Agent instance.
- Should a configuration directory be specified then the following order of precedence 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-delay
- Specifies the delay for terminating job processes on Unix in case the Agent is terminated. A value
--sigkill-delay=5
will specify 5 seconds. Default: 3
. - When the Agent is crashed or is stopped then remaining job processes and child processes will be forcibly terminated by the JS7 - Agent Watchdog.
- if the
--sigkill-delay
option specifies a positive, non-zero value- send processes and child processes created by the Agent the SIGTERM signal,
- wait for the period specified with the
--sigkill-delay
option,
- send remaining job processes and child processes the SIGKILL signal.
- When using JS7 - systemd Service Files for automated Startup and Shutdown with Unix Systems users should consider that
--timeout
and --sigkill-delay
values will count towards the systemd service file's TimeoutStopSec
setting. Users must ensure that the Agent is terminated when the systemd timeout is exceeded. - The option is available for Agents running on Unix starting from release 2.7.2, see
Jira |
---|
server | SOS JIRA |
---|
columnIds | issuekey,summary,issuetype,created,updated,duedate,assignee,reporter,priority,status,resolution |
---|
columns | key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution |
---|
serverId | 6dc67751-9d67-34cd-985b-194a8cdc9602 |
---|
key | JS-2148 |
---|
|
--timeout
--kill-script
The kill script provides the functionality to kill tasks and child processes of jobs.
- Kill scripts are by default provided from the following locations:
The option can be used to specify the location of an individual kill script if required.
Should an individual kill script be specified then the following order of precedence applies:
- First precedence: command line option
- Second precedence: environment variable
JS7_AGENT_KILL_SCRIPT
(see below) - Third precedence: use of default value
- Starting from release 2.7.2 the option is ignored, see
Jira |
---|
server | SOS JIRA |
---|
columnIds | issuekey,summary,issuetype,created,updated,duedate,assignee,reporter,priority,status,resolution |
---|
columns | key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution |
---|
serverId | 6dc67751-9d67-34cd-985b-194a8cdc9602 |
---|
key | JS-2148 |
---|
|
--java-options
This option can be used to apply Java options for the Agent, e.g. for memory settings, see JS7 - FAQ - Which Java Options are recommended.
Without this option being used the Java options default to -Xms100m
.
- In order to specify a number of Java options quotes have to be used like this:
--java-options="-Xms100m -Xmx1g"
When specifying Java options then the following order of precedence applies:
- First precedence: command line option
- Second precedence: environment variable
JAVA_OPTIONS
(see below) - Third precedence: use of default value
Switches
-c , --curl
- Specifies that the
curl
utility should be used instead of the built-in HTTP client when sending commands to the Agent.
--sigkill
- Starting from release 2.7.2 the switch is ignored.
Watchdog Script agent_watchdog.sh, agent_watchdog.cmd
Technically the Agent is started and is restarted from its Watchdog Script, for details see JS7 - Agent Watchdog.
The Watchdog Script is used to terminate job processes and child processes in case that the Agent is crashed.
Instance Start Script: agent_<port>.sh, agent_<port>.cmd
The JS7 Agent includes a template file for an Instance Start Script that can be adjusted to specify start-up parameters.
- The Instance Start Script sets a number of environment variables and finally executes the Start Script.
- In the Instance Start Script start-up parameters can be specified from environment variables, see below.
It is recommended that an individual Instance Start Script is created from the template file as this allows to specify individual start-up parameters from environment variables.
Location
- The default location of the Instance Start Script template file is:
- 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 that the template file is copied to 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 is performed on Windows using the installer, either in headless mode or in graphical mode, then the installer will automatically create this script.
- If the Agent installation 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.
- Users can adjust start-up parameters from environment variables once the Instance Start Script has been copied, as described below.
Usage
The Instance Start Script can be executed with the same arguments as the Start Script, as described above.
Anchor |
---|
| environment_variables |
---|
| environment_variables |
---|
|
Agent Environment Variables
Most environment variables in the Instance Start Script correspond to command line options in the Start Script (described above). The following environment variables can be modified in the script:
JS7_AGENT_HOME
- Points to the directory where the JS7 Agent has been installed.
- If this environment variable is not set then the default value will be used, which is the parent directory of the Agent Start Script.
- If the Agent is started from a directory other than the Agent installation directory, 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 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 start-up and shutdown that are executed by
root
, 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, for example with
JS7_AGENT_HTTP_PORT=myHost:4444
. - If only a port number is specified then the Agent will listen to all available network interfaces via HTTP.
- Without setting this environment variable the default port of
4445
will be used. - 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, for example with
JS7_AGENT_HTTPS_PORT=myHost:4443
. - If 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 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_PID_FILE_NAME
- Sets the file name to which the JS7 Agent stores its PID.
- The default value is
agent.pid
. - There is no corresponding command line option.
Display feature availability |
---|
|
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_DATA
. - There is no corresponding command line option.
JS7_AGENT_KILL_SCRIPT
JAVA_HOME
- Points to the location of the JVM, either a JRE (Java Runtime Environment) or JDK (Java Development Kit).
- When this environment variable is not set, Java will be used from the location specified by the system path.
- 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.
- When this environment variable is not set, the Java options will default to
-Xms100m
. - Corresponding command line option:
--java-options
JS7_AGENT_JOB_JAVA_OPTIONS
- Sets Java options for shell jobs that start a JVM.
- Corresponding command line option:
--job-java-options
Individual Environment Variables
In addition to Agent Environment Variables individual environment variables can be added. Such environment variables are made available for jobs like this:
Code Block |
---|
language | bash |
---|
title | Usage on Unix |
---|
|
SCRIPT_PATH=/var/scripts
export SCRIPT_PATH |
Code Block |
---|
language | bash |
---|
title | Usage on Windows |
---|
|
set SCRIPT_PATH=C:\ProgramData\scripts |
Running the Agent
- SOS does not recommend running the JS7 Agent with the
root
account (for Unix) or 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 are to 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.
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
.
Starting the Agent
Code Block |
---|
|
agent_4445.sh|.cmd start [options] |
When used for Container operation using Unix OS then the following command is used:
Code Block |
---|
|
agent_4445.sh start-container [options] |
The command is used to start the JS7 Agent in a container:
- The command will keep the start script running as PID 1 in order to receive later SIGTERM, SIGKILL signals from the container management software.
- The command
start-docker
is an alias for start-container
. Jira |
---|
server | SOS JIRA |
---|
columnIds | issuekey,summary,issuetype,created,updated,duedate,assignee,reporter,priority,status,resolution |
---|
columns | key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution |
---|
serverId | 6dc67751-9d67-34cd-985b-194a8cdc9602 |
---|
key | SET-223 |
---|
|
Stopping the Agent
Code Block |
---|
|
# terminate jobs and stop Agent
agent_4445.sh|.cmd stop [options]
# terminate jobs on Unix by sending SIGKILL with a delay of 10s and stop Agent
agent_4445.sh stop --sigkill-delay=10
# wait for jobs to terminate within 60s and stop Agent
agent_4445.sh|.cmd stop --timeout=60
# wait for jobs to terminate and stop Agent
agent_4445.sh|.cmd stop --timeout=never |
This command will terminate the Agent.
- Unix
- Job processes and child processes will be terminated and the Agent will terminate with exit code 0.
- collect PIDs of job processes,
- send SIGTERM signal to remaining job processes and child processes for which PIDs have been collected,
- wait for the grace timeout specified with the job or for stdout/stderr to be released by processes whichever is earlier,
- send SIGKILL signal to job processes and child processes,
- terminate the Agent with exit code 0.
- Windows
- Job processes and child processes will be forcibly terminated and the Agent will terminate with exit code 0.
- Using the
--timeout
option will wait for the indicated timeout that the Agent terminates. If the timeout is exceeded and if the Agent is still running, then Agent and jobs will be focibly terminated. The option accepts a number of seconds or the never
value that indicates that the Agent will wait endlessly until job processes and child processes will terminate.
- Agent
- collect PIDs of job processes,
- terminate the Agent with exit code 143 for Unix and 99 for Windows.
- Watchdog
- Unix
- if the
--sigkill-delay
option is used- send SIGTERM signal to remaining job processes and child processes for which PIDs have been collected,
- wait for the indicated delay or for stdout/stderr to be released by processes whichever is earlier,
- send SIGKILL signal to remaining job processes and child processes.
- Windows
- forcibly terminate job processes and child processes.
Code Block |
---|
|
agent_4445.sh|.cmd abort [options] |
The Agent process will terminate.
Starting from release 2.7.2 the command is deprecated and is replaced by the stop
command, optionally for Unix using the --sigkill-delay=0
option.
Code Block |
---|
|
agent_4445.sh|.cmd cancel | kill [options] |
The Agent process is forcibly terminated.
- The
kill
command can be used as an alias to cancel
. - The command corresponds to sending a SIGKILL signal with a
kill -9
OS command (Unix) or taskkill
command (Windows) to the Agent. - Should jobs be running then they will be terminated by the JS7 - Agent Watchdog similar to crash of the Agent.
Anchor |
---|
| #restart_agent |
---|
| #restart_agent |
---|
|
Restarting the Agent Code Block |
---|
|
# terminate jobs and restart Agent
agent_4445.sh|.cmd restart [options]
# terminate jobs on Unix by sending SIGKILL with a delay of 10s and restart Agent
agent_4445.sh restart --sigkill-delay=10
# wait for jobs to terminate and restart Agent
agent_4445.sh|.cmd restart --timeout=never |
The command will restart the Agent.
- Job processes and child processes will be terminated and the Agent will terminate as explained in chapter Stopping the Agent.
- The Agent is started similar to use of the
start
command using the same options as for initial start. - The
--timeout
option for Unix/Windows and the --sigkill-delay
option for Unix can be used.
Anchor |
---|
| #status_agent |
---|
| #status_agent |
---|
|
Checking the Agent Status Code Block |
---|
|
agent_4445.sh|.cmd status [options] |
If the Agent is up and running then this command results 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:
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 |
Switching-over the Active Director Agent Instance
Code Block |
---|
|
agent_4445.sh|.cmd switch-over [options] |
If an Agent Cluster is operated then the command will switch the active role from the Active Director Agent instance to the Standby Director Agent instance. The command can be executed for the Active Director Agent .
After switch-over the Agent instance is restarted.
Performing Certificate Rollout Code Block |
---|
|
agent_4445.sh|.cmd cert [cert-options] |
This command is used to generate an SSL/TLS Certificate for client and server authentication.
For details and command line options see JS7 - Certificate Authority - Rollout Certificates for HTTPS Connections
Windows Service Interface
The following information applies to headless installation for The following information applies to batch installation on Windows systems. For installation with a GUI and user dialog see JobScheduler Universal JS7 - Agent - Installation with Using the Windows Graphical Installer.
The Agent is operable as a Windows Service. The Start Script of the Agent allows the installation/removal of the Windows Service. The start script of the Agent allows installing/removing the Windows Service
The examples below make use of an Instance Start Script agent_4445.cmd
, which is created from the template file to run the Agent for port 4445
.
Installing the Windows Service
Code Block |
---|
|
agent_4445.cmd install-service [--http-port=<number>] [-ip-address=<hostname or ip address>]<[interface:]number>] |
The 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 the service installation, it 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. C:\Program Files. In this case you can change the permissions of the .\service directory or open the command prompt with elevated administrator rights and execute the above command once more. |
Windows Service. After the installation, 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.
Warning |
---|
During service installation, the installer tries to copy the executable file for the Windows Service to the .\service directory. This operation can fail with the error "Access denied" if the Agent has been extracted to, for example, C:\Program Files. In this case 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. |
Starting the Windows Service
Code Block |
---|
|
agent_4445.cmd start-service [--http-port=<[interface:]number>] |
The command starts the Windows Service with the name SOS JS7 Agent -port=<number>.
Info |
---|
The stop command checks whether the Agent was started by the command line interface or as a Windows Service and stops the Agent accordingly. Therefore there is no stop-service command. |
Removing
...
the Windows Service
Code Block |
---|
|
agent_4445.cmd startremove-service [--http-port=<number>] |
This command starts the Windows Service with the name SOS JS7 Agent -port=<number>.
Info |
---|
The stop command contains more than a simple stop-service command: the stop command checks whether the Agent was started through the CLI or as a Windows Service and stops the Agent accordingly. Therefore there is no stop-service command. |
Removing the Windows Service
Code Block |
---|
|
agent.cmd remove-service [-http-port=<number>] |
This command removes the Windows Service. After executing this command you will 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 .\service directory. This operation could fail with the error "Access denied" if you have extracted the Agent to e.g. C:\Program Files. In this case you 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 find the .\service\sos_js7_agent_<http-port>w.exe
file. Start this program to configure the Windows Service.
...
Image Removed ...
The command removes the Windows Service. After executing the command 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 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 users have extracted the Agent to e.g. C:\Program Files. In this case 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 installation of the Windows Service users find the .\service\js7_agent_<http-port>w.exe
file. The program can be executed to configure the Windows Service.
Image Added | For example go to the "Startup" tab to modify start parameters |
Debugging the Windows Service
- For general information see JS7 - Log Levels and Debug Options.
- The log level can be increased by using the Agent's Apache ProcRun Daemon Service Manager daemon/service. On Windows systems this is installed in the Agent's
service
directory with a name such as js7_agent_<port>w.exe
where <port>
is the Agent's HTTP port. - Users can start the ProcRun Manager, select the Logging tab in the user interface and set the log level to Debug.
- For the location of log files see JS7 - Log Files and Locations.
- Users should consider reverting the debug log level to its original value once they are finished with debugging.
Resources