Versions Compared

Key

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

...

Code Block
titleAgent Installer Script: js7_install_agent.sh
Usage: js7_install_agent.sh [Options] [Switches]

  Installation Options:
    --home=<directory>                 | required: directory to which the Agent shouldwill be installed
    --data=<directory>                 | optional: directory for Agent data files, default: <home>/var_4445
    --config=<directory>               | optional: directory from which the Agent reads configuration files, default: <data>/config
    --logs=<directory>                 | optional: directory to which the Agent writes log files, default: <data>/logs
    --work=<directory>                 | optional: working directory of the Agent, default: <data>
    --user=<account>                   | optional: user account for Agent daemon, default: $USER
    --release=<release-number>         | optional: release number such as 2.5.0 for download if --tarball is not used
    --tarball=<tar-gz-archive>         | optional: the path to a .tar.gz archive that holds the Agent tarball,
                                       |           if not specified the Agent tarball will isbe downloaded from the SOS web site
    --patch=<issue-key>                | optional: identifies a patch for an existing Agent installation
    --http-port=<port>                 | optional: specifies the http port the Agent will isbe operated for, default: 4445
                                                   port can be prefixed by network interface, e.g. localhost:4445
    --https-port=<port>                | optional: specifies the https port the Agent iswill be operated for
                                                   port can be prefixed by network interface, e.g. batch.example.com:4445
    --instance-script=<path>           | optional: path to the Instance Start Script that iswill be copied to the Agent, default <home>/bin/<instance-script>
    --service-file=<path>              | optional: path to the systemd Service File that is copied to the Agent, default <home>/bin/<service-file>
    --pid-file-dir=<directory>         | optional: directory to which the Agent shouldwrites write its PID file, default: <data>/logs
    --pid-file-name=<file-name>        | optional: file name used by the Agent to write its PID file, default: agent.pid
    --java-home=<directory>            | optional: Java Home directory for use with the Instance Start Script
    --java-options=<options>           | optional: Java Options for use with the Instance Start Script
    --backup-dir=<directory>           | optional: backup directory for existing Agent home directory
    --log-dir=<directory>              | optional: log directory for log output of this script
    --execservice-start=<command>   dir=<directory>          | optional: commandsystemd toservice startdirectory, the Agent, e.g. 'sudo systemctl start agent'default: /usr/lib/systemd/system
    --execservice-stopfile=<command><path>              | optional: commandpath to stop the Agent, e.g. 'sudo systemctl stop agent'a systemd service file that will be copied to the Agent
    --returnservice-valuesname=<path><name>              | optional: pathname toof athe filesystemd thatservice holdsto returnbe valuescreated, such as the path to a log file

  Configuation Options:
    --deploy-dir=<dir>[,<dir>]default js7_agent_<http-port>
    --exec-start=<command>                 | optional: deploymentcommand directoryto fromstart whichthe configuration files are copied to the AgentAgent, e.g. 'StartService'
    --agentexec-confstop=<path>  <command>              | optional: pathcommand to astop configurationthe file that is copied to <config>/agent.confAgent, e.g. 'StopService'
    --privatereturn-confvalues=<path>              | optional: path to a configuration file that isholds return copiedvalues to <config>/private/private.conf
    --controller-id=<identifier>       | optional: Controller ID, default: controllersuch as the path to a log file

  Configuration Options:
    --controllerdeploy-primary-cert=<file>dir=<dir>[,<dir>]    | optional: path to Primary/Standalone Controller| certificateoptional: file
deployment directory from  --controller-secondary-cert=<file> | optional: pathwhich configuration files are copied to Secondary Controller certificate filethe Agent
    --keystoreagent-conf=<path>                  | optional: path to a PKCS12configuration keystore file that iswill be copied to <config>/private/agent.conf
    --keystoreprivate-password=<password>conf=<path>              | optional: password for access to keystore path to a configuration file that will be copied to <config>/private/private.conf
    --keystorecontroller-alias=<alias-name>id=<identifier>       | optional: aliasController nameID, for keystore entrydefault: controller
    --truststore=<path>controller-primary-cert=<file>   | optional: path to Primary/Standalone Controller certificate file
      --controller-secondary-cert=<file> | optional: path to aSecondary PKCS12Controller truststorecertificate file that is copied to <config>/private/
    --truststore-password=<password>keystore=<path>      | optional: password for truststore password

  Switches:
    -h | --help            optional: path to a PKCS12 keystore file that will be copied to <config>/private/
    --keystore-password=<password>     | optional: password for |access displaysto usagekeystore
    --keystore-showalias=<alias-logsname>      | optional: alias name for keystore entry
    --truststore=<path>         | shows log output of the script
 | optional: path --make-dirsto a PKCS12 truststore file that will be copied to <config>/private/
           --truststore-password=<password>   | createsoptional: thepassword specifiedfor directoriestruststore ifpassword

 they doSwitches:
 not exist
  -h | --move-libshelp                        | movesdisplays anusage
 existing Agent's lib directory--show-logs instead of removing the directory
    --remove-journal               | shows log output |of removesthe anscript
 existing Agent's state directory--make-dirs that holds the journal files
    --restart               | creates the specified directories if they do not exist
  | stops a--make-service running Agent and starts the Agent after installation
    --abort         | creates the systemd service for the Agent
    --move-libs        | aborts a running Agent if used with the --restart switch
    --kill  | moves an existing Agent's lib directory instead of removing the directory
    --remove-journal            | kills a running Agent if used with the --restart switch

Installation Options

    | removes an existing Agent's state directory that holds the journal files
    --restart                          | stops a running Agent and starts the Agent after installation
    --abort                            | aborts a running Agent if used with the --restart switch
    --kill                             | kills a running Agent if used with the --restart switch 

Installation Options

  • --home
    • Specifies the directory in which the Agent should be installed.
  • --data
    • Specifies the
  • --home
    • Specifies the directory in which the Agent should be installed.
  • --data
    • Specifies the directory in which Agent data such as configuration files should be stored.
    • By default the <home>/var_<http-port> directory is used, see options --home and --http-port.
  • --config
    • Specifies the directory from which the Agent reads configuration files.
    • By default the <data>/config directory is used, see option --data.
  • --logs
    • Specifies the directory to which the Agent stores log files.
    • By default the <data>/logs directory is used, see option --data.
  • --work
    • Specifies the working directory of the Agent.
    • By default the <data> directory is used, see option --data.
  • --user
    • Specifies the user account for the Agent daemon.
    • By default the account of the user running the Agent Installer Script is used.
  • --release
    • Specifies a release number such as 2.3.1 for download from the SOS web site if the --tarball option is not used, see option --data.
  • --usertarball
    • Specifies the user account for the Agent daemon.
    • By default the account of the user running the Agent Installer Script is used.
    • Optionally specifies the path to a .tar.gz file that holds the Agent installation files. If this option is not used the installer tarball will be downloaded from the SOS web site for the release indicated with the --release option.
    • Download is performed with curl that considers http_proxy and https_proxy environment variables and respective settings from a .curlrc file.
  • --patch--release
    • Specifies a release number such as 2.3.1 for download from the SOS web site if the if the --tarball option is not used.
  • --tarball
    • Optionally specifies the path to a .tar.gz file that holds the Agent installation files. If this option is not used the installer tarball will be downloaded from the SOS web site for the release indicated with the --release option.
    • Download is performed with curl that considers http_proxy and https_proxy environment variables and respective settings from a .curlrc file.
  • --patch
    • A patch is identified by an issue key in the Change Management System, for example JS-1984.
    • Patches are downloaded from the SOS web site if the --tarball option is not used.
    • Patches are added to the Agent's <home>/lib/patches directory. Note that the patches sub-directory will be emptied when updating a Controller installation later on.
    • If a backup directory is specified then an Agent's existing installation directory will be added in a .tar.gz file in this directory.
    • Patches are added to the Agent's <home>/lib/patches directory. Note that the patches sub-directory will be emptied when updating a Controller installation later on.
    • If a backup directory is specified then an Agent's existing installation directory will be added in a .tar.gz file in this directory.
  • --http-port
    • Specifies the HTTP port that the Agent is operated for. The default value is 4445. The Agent by default makes use of a configuration directory ./var_<http-port> that will be excluded from a backup taken with the --backup-dir option. In addition the HTTP port is used to identify the Agent Instance Start Script typically available from ./bin/agent_<http-port>.sh. and to specify the value of the JS7_AGENT_HTTP_PORT environment variable in the script.
    • The port can be prefixed by the network interface, for example localhost:4445.
    • When used with the --restart switch the HTTP port is used to identify whether the Agent is running.
  • --https-port
    • Specifies the HTTPS
    --http-port
    • Specifies the HTTP port that the Agent is operated for. The default value is 4445. The Agent by default makes use of a configuration directory ./var_<http-port> that will be excluded from a backup taken with the --backup-dir option. In addition the HTTP port is used to identify HTTPS port is specified in the Agent Instance Start Script typically available from ./bin/agent_<http-port>.sh. with the environment variable JS7_AGENT_HTTPS_PORT. Use of HTTPS requires a keystore and to specify the value of the JS7_AGENT_HTTP_PORT environment variable in the scripttruststore to be present, see --keystore and --truststore options.
    • The port can be prefixed by the network interface, for example batch.examplelocalhost.com:4445.
    • When used with the --restart switch the HTTP port is used to identify whether the Agent is running.
    --https-port
  • --instance-script
    • Specifies the path to an Instance Start Script that acts as a template and that is copied to the bin directory. Typically the name agent_<http-port>.sh. is used. Users are free to choose any name for the Instance Start Script. The script has to be executable for the Agent daemon, see --user option. Permissions of the script are not changed by the Agent Installer Script.
    • The Agent Installer Script will perform replacements in the Instance Start Script template for known placeholders such as <JS7_AGENT_USER>, for details see
    • Specifies the HTTPS port that the Agent is operated for. The HTTPS port is specified in the Agent Instance Start Script typically available from ./bin/agent_<http-port>.sh. with the environment variable JS7_AGENT_HTTPS_PORT. Use of HTTPS requires a keystore and truststore to be present, see --keystore and --truststore options.
    • The port can be prefixed by the network interface, for example batch.example.com:4445.
  • --instance-script
    • Specifies the path to an Instance Start Script that acts as a template and that is copied to the bin directory. Typically the name agent_<http-port>.sh. is used. Users are free to choose any name for the Instance Start Script. The script has to be executable for the Agent daemon, see --user option. Permissions of the script are not changed by the Agent Installer Script.
    • The Agent Installer Script will perform replacements in the Instance Start Script template for known placeholders such as <JS7_AGENT_USER>, for details see ./bin/agent_instance.sh-example.
  • --service-file
    • Specifies the path to a systemd Service File that acts as a template and that is copied to the bin directory. Typically the name agent_<http-port>.service is used. Users are free to choose any name for the Service File.
    • The Agent Installer Script will perform replacements in the Service File template for known placeholders such as <JS7_AGENT_USER>, for details see ./bin/agent.service-example.
  • --pid-file-dir
    • Specifies the directory to which the Agent stores its PID file. By default the <data>/logs directory is used.
    • When using SELinux then it is recommended to specify the /var/run directory, see JS7 - How to install for SELinux.
  • --pid-file-name
    • Specifies the name of the PID file. By default the file name agent.pid is used.
    • The PID file is created in the directory specified by the --pid-file-dir option.
  • --java-home
    • Specifies the Java home directory that will be made available to the Agent from the JAVA_HOME environment variable specified with the Agent Instance Start Script typically available from ./bin/agent_<http-port>.sh.
  • --java-options
    • Specifies the Java options that will be made available to the Agent from the JAVA_OPTIONS environment variable specified with the Agent Instance Start Script typically available from ./bin/agent_<http-port>.sh.
    • Java options can be used for example to specify Java heap space settings for the Agent.
    • If more than one Java option is used then the value has to be quoted, for example --java-options="-Xms256m -Xmx512m".
  • --backup-dir
    • If a backup directory is specified then an Agent's existing installation directory will be added to a .tar.gz file in this directory.
    • File names are created according to the pattern: backup_js7_agent.<hostname>.<release>.<yyyy>-<MM>-<dd>T<hh>-<mm>-<ss>.tar.gz
    • For example: backup_js7_agent.centostest_primary.2.3.1.2022-03-19T20-50-45.tar.gz
    • instance.sh-example.
  • --pid-file-dir
    • Specifies the directory to which the Agent stores its PID file. By default the <data>/logs directory is used.
    • When using SELinux then it is recommended to specify the /var/run directory, see JS7 - How to install for SELinux.
  • --pid-file-name
    • Specifies the name of the PID file. By default the file name agent.pid is used.
    • The PID file is created in the directory specified by the --pid-file-dir option.
  • --java-home
    • Specifies the Java home directory that will be made available to the Agent from the JAVA_HOME environment variable specified with the Agent Instance Start Script typically available from ./bin/agent_<http-port>.sh.
  • --java-options
    • Specifies the Java options that will be made available to the Agent from the JAVA_OPTIONS environment variable specified with the Agent Instance Start Script typically available from ./bin/agent_<http-port>.sh.
    • Java options can be used for example to specify Java heap space settings for the Agent.
    • If more than one Java option is used then the value has to be quoted, for example --java-options="-Xms256m -Xmx512m".
  • --backup-dir
    • If a backup directory is specified then an Agent's existing installation directory will be added to a .tar.gz file in this directory.
    • File names are created according to the pattern: backup_js7_agent.<hostname>.<release>.<yyyy>-<MM>-<dd>T<hh>-<mm>-<ss>.tar.gz
    • For example: backup_js7_agent.centostest_primary.2.3.1.2022-03-19T20-50-45.tar.gz
  • --log-dir
    • If a log directory is specified then the installer script will log information about processing steps in a log file in this directory.
    • File names are created according to the pattern: install_js7_agent.<hostname>.<yyyy>-<MM>-<dd>T<hh>-<mm>-<ss>.log
    • For example: install_js7_agent.centostest_primary.2022-03-19T20-50-45.log
  • --service-dir
    • Specifies the systemd service directory to which the Agent's service file will be copied if the --make-service switch is used.
    • By default the a/usr/lib/systemd/system will be used. Users can specify an alternative location.
  • --service-file
    • Specifies the path to a systemd service file that acts as a template and that will be copied to the Agent's bin directory. Users are free to choose any file name as a template for the service file. The resulting service file name will be agent_<http-port>.service.
    • The Agent Installer Script will perform replacements in the service file to update paths and the port to be used, for details see ./bin/agent.service-example.
  • --service-name
    • Specifies the name of the systemd service that will be created if the --make-service switch is used.
    • By default the service name js7_agent_<http-port> will be used.
    --log-dir
    • If a log directory is specified then the installer script will log information about processing steps in a log file in this directory.
    • File names are created according to the pattern: install_js7_agent.<hostname>.<yyyy>-<MM>-<dd>T<hh>-<mm>-<ss>.log
    • For example: install_js7_agent.centostest_primary.2022-03-19T20-50-45.log
  • --exec-start
    • This option can be used if should the Agent is to be be started after installation from an individual command. For example, when using systemd then the option --exec-start="sudo systemctl start agent" will StartService" will start the Agent service provided that the agent_<http-port>.service file has been configured for systemdthe related systemd service has been created manually or by use of the --make-service switch. Alternatively users can specify individual commands, for example --exec-start="sudo systemctl start js7_agent_4445".
    • For systemd service files see JS7 - systemd Service Files for automated Startup and Shutdown with Unix Systems.
    • This option is an alternative to the use of the --restart switch which starts will start the Agent from its Instance Start Script. If specified this option overrules the --restart switch.
  • --exec-stop
    • This option can be used if should the Agent is to be stopped before installation from an individual command. For example, when using systemd then the option --exec-stop="sudo systemctl stop agent" will StopService" will stop the Agent provided that the agent_<http-port>.service file has been configured for systemdservice provided that the related systemd service has been created manually or by use of the --make-service switch. Alternatively users can specify individual commands, for example --exec-stop="sudo systemctl stop js7_agent_4445".
    • For systemd service files see JS7 - systemd Service Files for automated Startup and Shutdown with Unix Systems.
    • This option is an alternative to the use of the --restart switch which stops the Agent from its Instance Start Script. If specified this option overrules the --restart switch.
  • --return-values
    • Optionally specifies the path to a file to which return values will be added in the format <name>=<key>. For example:
      • log_file=install_js7_agent.centostest_primary.2022-03-20T04-54-31.log
      • backup_file=backup_js7_agent.centostest_primary.2.3.1.2022-03-20T04-54-31.tar.gz
    • An existing file will be overwritten. It is recommended to use a unique file name such as /tmp/return.$$.$RANDOM.properties.
    • A value from the file can be retrieved like this:
      • backup=$(cat /tmp/return.$$.$RANDOM.properties | grep "backup_file" | cut -d'=' -f2)

...

  • -h | --help
    • Displays usage.
  • --show-logs
    • Displays the log output created by the script if the --log-dir option is used.
  • --make-dirs
    • If directories are missing that are indicated with the --home, --backup-dir or --log-dir options then they will be created.
  • --make-service
    • Specifies that a systemd service should be created for the Agent. The service will be created from the --service-name option or its default value.
  • --move-libs
    • For an existing Agent installation the lib sub-directory includes .jar files that carry the release number in their file names. If replaced by a newer version the lib directory has to be moved or removed. This switch tries to move the directory to a previous version number as indicated from the .version file in the Agent's home directory, for example to rename lib to lib.2.3.1.
    • Files in the lib/user_lib sub-directory are preserved.
  • --remove-journal
    • If Agents have been installed for the wrong operating mode (standalone, clustered) then the Agent's journal in the JS7_AGENT_DATA/state directory can be removed. This operation removes any orders submitted to an Agent and requires the Agent to be re-registered to a Controller.
  • --restart
    • Stops a running Agent before installation and starts the Agent after installation using the Agent's Instance Start Script. This switch can be used with the --abort and --kill switches to control the way how the Agent is terminated. This switch is ignored if the --exec-start and --exec-stop options are used.
  • --abort
    • Aborts a running Agent and kills any running tasks including child processes if used with the --restart switch. Aborting an Agent includes to terminate the Agent in an orderly manner that allows to close files consistently.
  • --kill
    • Kills a running Agent and any running tasks if used with the --restart switch. This includes killing child processes of running tasks.

...