Page History
...
Code Block | ||||
---|---|---|---|---|
| ||||
Usage: agent.sh command [options] command: start [options] start-container [options] stop [options] abort [options] restart [options] status [options] killcancel | kill [options] cert [cert-options] | see https://kb.sos-berlin.com/x/jLbAAw options: --http-port=<[hostname or ip address:]number>interface:]port> | http network interface and port, default: 4445 --https-port=<[hostname or ip address:]number>interface:]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 --sigkill-delay=<seconds> | send SIGTERM and delayed SIGKILL signal, default: 3 --timeout=<seconds> | only for stop and restart; running tasks will be killed --sigkill-delay | timeout for terminating jobs on Agent stop --kill-script=<path> | running tasks are terminated after crash using SIGTERM and SIGKILL with a delay | user kill script on Agent start (deprecated) --java-options=<java options> | default: -Xms100m -Dfile.encoding=UTF-8; see https://kb.sos-berlin.com/x/aIC9 switches: -c | default: 3 --curl --timeout=<timeout > 0, in seconds> | only for stop; if timeout is reached then SIGKILL is sent --kill-script=<location of kill script> | use curl instead of Java http client -f | --force | only--sigkill for start --java-options=<java options> | force |termination default:of -Xms100m -Dfile.encoding=UTF-8; jobs on Agent stop and restart see https://kb.sos-berlin.com/x/aIC9 fAmGAw for more information. |
Code Block | ||||
---|---|---|---|---|
| ||||
Usage: agent.cmd command [options] command: -c | --curl start [options] start-container [options] stop [options] | use curlabort instead of the Java http client see https://kb.sos-berlin.com/x/fAmGAw for more information. | ||||
Code Block | ||||
| ||||
Usage: agent.cmd command [options] command: restart start [options] status start-container [options] stop [options] cancel | kill [options] abortcert [cert-options] restart [options] status | see https://kb.sos-berlin.com/x/jLbAAw options: [options] --http-port=<[interface:]port> kill [options] cert | http network interface and port, default: 4445 [cert-options]--https-port=<[interface:]port> | https |network see https://kb.sos-berlin.com/x/jLbAAw optionsinterface and port, default: --httpdata-port=<[hostname or ip address:]number> | default: 4445 directory=<directory> --https-port=<[hostname or ip address:]number> | default: --data-directory=<location of data directory> | default: /var/sos-berlin.com/js7/agent/var_4445 --config-directory=<location<directory> of config directory> | | default: /var/sos-berlin.com/js7/agent/var_4445/config --timeout=<timeout > 0, in seconds><seconds> | only for stop; if| timeout isfor reachedterminating thenjobs KILLon isAgent sentstop --kill-script=<location<path> of kill script> | only for start --java-options=<java options> | user kill script on Agent start (deprecated) --java-options=<java options> | default: -Xms100m -Dfile.encoding=UTF-8; see https://kb.sos-berlin.com/x/aIC9 switches: see https://kb.sos-berlin.com/x/fAmGAw for more information. |
Command Line Options
-f | --force | force termination of jobs on Agent stop and restart
see https://kb.sos-berlin.com/x/fAmGAw for more information. |
Command Line Options
--http-port=<[hostname or ip address:]--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 port number. - 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
- 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 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 port number. - This option can be used to indicate which network interfaces 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 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. - 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
- 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 the location of the data directory that usually includes the
config
,logs, tmp
andstate
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>
- Specifies the location of the data directory that usually includes the
--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 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>
- Specifies the location of the
--sigkillforce
With the
stop
andrestart
commands this option terminates any running processes of jobs. See explanations to the--sigkill-delay
option.- The option is available for Agents running on Unix.
--sigkill-delay
- Specifies the delay for killing job processes in case the Agent is terminated. A value
--sigkill-delay=5
will specify 5 seconds. Default:3
. - In a situation when the Agent is crashed or is terminated using the
--sigkillforce
switch, the Agent's Watchdog Script will terminate remaining job processes and child processes.- if the
--sigkill-delay
option specifies a positive, non-zero value- send all 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.
- if the
- The option is available for Agents running on Unix.
- This option is available 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
- Specifies the delay for killing job processes in case the Agent is terminated. A value
--timeout
With the
stop
command this option waits for the indicated number of seconds and kills the Agent including any running processes of jobs if the timeout is exceeded.
--kill-script=<location of kill script><path>
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 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 this 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=<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 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
--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 quotes have to be used like this:
--job-java-options="-Xms100m -Xmx1g"
When specifying Java options for execution with Shell jobs then the following order of precedence applies:
- First precedence: command line option
- Second precedence: environment variable
JS7_AGENT_JOB_JAVA_OPTIONS
(see below)
...
- The command will keep the start script running as PID 1 in order to receive later stop/kill signals (SIGTERM, SIGKILL) from the container management software.
- The command
start-docker
is an alias forstart-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
...
6dc67751-9d67-34cd-985b-194a8cdc9602 key SET-223
Anchor #stop_agent #stop_agent
Stopping the Agent
#stop_agent | |
#stop_agent |
Code Block | ||
---|---|---|
| ||
agent_4445.sh|.cmd stop [options] |
This command will safely terminate the Agent (recommended).
- The Agent waits for running job processes to be completed.
- Unix
- Using the
--force
command line option will immediately terminate any running job processes and will terminate the Agent normally.- collect PIDs of job processes,
- 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 shorter,
- send SIGKILL signal to job processes and child processes,
- terminate the Agent with exit code 0.
- Using the
- Windows
- Using the
--force
command line option will forcibly terminate job processes and child processes
- Using the
...
Code Block | ||
---|---|---|
| ||
agent_4445.sh|.cmd 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 in a Unix environment will immediately terminate any running job processes and will terminate the Agent normally- .
- Using the
--timeout
command line option will wait for the indicated timeout that the Agent terminates. If the timeout is exceeded and if the Agent is still running then jobs are then Agent and runing jobs will be focibly terminated.Termination of jobs and of the Agent are performed by the Watchdog Script using the following actions::- Agent
- collect PIDs of job processes,
- terminate the Agent with exit code 143 for Unix.
- 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 shorter,
- send SIGKILL signal to remaining job processes and child processes
- if the
- Unix
- terminate the Agent.
- .
- Windows
- forcibly terminates job processes and child processes.
- Agent
- Only one of the
--force
and--timeout
options can be used.
Code Block | ||
---|---|---|
| ||
agent_4445.sh|.cmd abort [options] |
The Agent process is immediately aborted.
- Any running tasks and child processes of jobs are terminated immediately with a SIGKILL signal.
- Should tasks use resources such as database connections then they will not be properly closed.
will be terminated.
The command is deprecated and is replaced by the stop
command using the --force
or --timeout
options.
Code Block | ||
---|---|---|
| ||
agent_4445.sh|.cmd cancel | kill [options] |
The Agent process is terminatedprocess is forcibly terminated.
- The
kill
command can be used alternatively tocancel
. - This corresponds to sending a SIGKILL signal with a
kill -9
command (Unix) ortaskkill
command (Windows). - Should jobs be running that start detached child processes then it is not guaranteed that child processes will be killedthen they will be terminated by the JS7 - Agent Watchdog similar to crash of the Agent.
Anchor | ||||
---|---|---|---|---|
|
...
- The Agent waits for running processes of any jobs to be completed.
- Unix
- Using the
--
force
--timeout
- command line
- option will terminate any running job processes and will terminate the Agent as explained in chapter Stopping the Agent.
- The Agent terminates with exit code 97
- Using the
- Windows
- Using the --xxx command line option
- The Agent terminates with exit code 98.
- The
--timeout
command line option cannot be usedAfter termination the Agent will be restarted.
Anchor | ||||
---|---|---|---|---|
|
...