Versions Compared

Key

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

...

Code Block
languagetext
titleUsage for Unix
Usage: agent.sh command [options]
  command:
    start           [options]
    start-container [options]
    stop            [options]
    restart         [options]
    status          [options]
    cancel | kill   [options]
    cert            [cert-options]                    | see https://kb.sos-berlin.com/x/jLbAAw
  options:
    --http-port=<[interface:]port>                    | http network interface and port, default: 4445
    --https-port=<[interface:]port>                   | https network interface and port, default:
    --data-directory=<directory>                      | default: /var/sos-berlin.com/js7/agent/var_4445
    --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>                               | timeout for terminating jobs on Agent stop
    --java-options=<java options>          |           | default: -default: -Xms100m -Dfile.encoding=UTF-8; see https://kb.sos-berlin.com/x/aIC9
   switches: 
    -c | --curl                                       | use curl instead of Java http client

see https://kb.sos-berlin.com/x/fAmGAw for  -f | --force | --sigkill more information.



Code Block
languagetext
titleUsage for Windows
Usage: agent.cmd command [options]
  command:
    start           [options]
    start-container [options]
    stop  | force termination of jobs on Agent stop and restart

see https://kb.sos-berlin.com/x/fAmGAw for more information.
Code Block
languagetext
titleUsage for Windows
Usage: agent.cmd command [options]
  command:
   restart start           [[options]
    start-container [options]
    stop            [options]
    restart         [options]
    status          [options]
    cancel | kill   [options]
    cert            [cert-options]                    | see https://kb.sos-berlin.com/x/jLbAAw
  options:
    --http-port=<[interface:]port>                    | http network interface and port, default: 4445
    --https-port=<[interface:]port>        | https network         | https network interface interface and port, default:
    --data-directory=<directory>                      | default: /var/sos-berlin.com/js7/agent/var_4445
    --config-directory=<directory>                    | default: /var/sos-berlin.com/js7/agent/var_4445/config
    --timeout=<seconds>                               | timeout for terminating jobs on Agent stop
    --java-options=<java options>                     | default: -Xms100m -Dfile.encoding=UTF-8; see https://kb.sos-berlin.com/x/aIC9
  switches:
    -fc | --forcecurl                            | use curl instead of Java http client   | force termination of jobs on Agent stop and restart

see https://

see https://kb.sos-berlin.com/x/fAmGAw for more information.

...

  • --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 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
  • --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 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 terminated using the --force switch, the Agent's Watchdog Script will terminate stopped then remaining job processes and child processes will be forcibly terminated.
      • 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.
    • The option is available for Agents running on Unix starting from release 2.7.2, see
      Jira
      serverSOS JIRA
      columnIdsissuekey,summary,issuetype,created,updated,duedate,assignee,reporter,priority,status,resolution
      columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
      serverId6dc67751-9d67-34cd-985b-194a8cdc9602
      keyJS-2148
  • --timeout
    • With the stop command and restart commands this option waits for the indicated number of seconds duration and terminates the Agent including any job processes if the timeout is exceeded.

    • The option accepts a number of seconds or the never value to wait endlessly for jobs to terminate.
  • --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 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 the option is ignored, see see
      Jira
      serverSOS JIRA
      columnIdsissuekey,summary,issuetype,created,updated,duedate,assignee,reporter,priority,status,resolution
      columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
      serverId6dc67751-9d67-34cd-985b-194a8cdc9602
      keyJS-2148
  • --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

...

  • -c ,  --curl
    • Specifies that the curl utility should be used instead of the built-in HTTP client when sending commands to the Agent.
  • -f, --forcesigkill
    • Starting from release 2.7.2 the switch is ignored
    • With the stop and restart commands this option terminates any running processes of jobs. See explanations to the --sigkill-delay option.

    • When operated for Unix, the alternative option name --sigkill can be used.

Watchdog Script agent_watchdog.sh, agent_watchdog.cmd

...

Anchor
#stop_agent
#stop_agent
Stopping the Agent

Code Block
languagebash
# terminate jobs and stop Agent
agent_4445.sh|.cmd stop [options]

This command will safely terminate the Agent (recommended).



# 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 safely terminate the Agent (recommended).

  • Unix
    • Running job processes and child processes will be terminated and the Agent will terminate normally.
  • The Agent waits for running job processes to be completed.
  • Unix
    • Using the --force switch will 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.
  • Windows
    • Using the --force switch will forcibly terminate job processes and child processes.
  • 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 then Agent and runing jobs will be focibly terminated:
    • Agent
      • collect PIDs of job processes,
      • terminate the Agent with exit code 143 for Unix.
      Watchdog
      • Unixif 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,
      • terminate the Agent with exit code 0.
  • Windows
    • forcibly terminates Running job processes and child processes .
  • Only one of the --force and --timeout options can be used.
Code Block
languagebash
agent_4445.sh|.cmd abort [options]

The Agent process will be terminated.

The command is deprecated and is replaced by the stop command using the --force or --timeout options.

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

The Agent process is forcibly terminated.

  • The kill command can be used alternatively to cancel.
  • This corresponds to sending a SIGKILL signal with a kill -9  command (Unix) or taskkill command (Windows).
  • Should jobs be running then they will be terminated by the JS7 - Agent Watchdog similar to crash of the Agent.

...

    • will be terminated forcibly and the Agent will terminate with exit code 0.
  • 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 then Agent and runing 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.
    • 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.
      • Windows
        • forcibly terminates job processes and child processes.


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

The Agent process will be terminated.

The command is deprecated and is replaced by the stop command, optionally for Unix using the --sigkill-delay=0 option.


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

The Agent process is forcibly terminated.

  • The kill command can be used alternatively to cancel.
  • The command corresponds to sending a SIGKILL signal with a kill -9  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
languagebash
# 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

...

Code Block
languagebash
agent_4445.sh|.cmd restart [options]--timeout=never

The command will safely restart the Agent (recommended).

  • Running 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 command line options as with initial start
  • The Agent waits for running processes of any jobs to be completed.
  • Using the --force  switch 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 on Unix and exit code 98 on Windows.
  • The --timeout option cannot option and  the --sigkill-delay option for Unix can be used.

Anchor
#status_agent
#status_agent
Checking the Agent Status

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

...

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

...