Versions Compared

Key

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

...

Code Block
titleController Installer Script: js7_install_controller.sh
Usage: js7_install_controller.sh [Options] [Switches]

  Installation Options:
    --home=<directory>                 | required: directory to which the Controller will be be installed
    --data=<directory>                 | optional: directory for Controller data files, default:  <home>/var
    --config=<directory>               | optional: directory from which the Controller reads configuration files, default: <data>/config
    --logs=<directory>                 | optional: directory to which the Controller writes log files, default: <data>/logs
    --user=<account>                   | optional: user account for Controller daemon, default: $USER
    --home-owner=<account[:group]>     | optional: account and optionally group owning the home directory, requires root or sudo permissions
    --data-owner=<account[:group]>     | optional: account and optionally group owning the data directory, requires root or sudo permissions
    --controller-id=<identifier>       | optional: Controller ID, default: controller
    --release=<release-number>         | optional: release number such as 2.2.3 for download if --tarball is not used
    --tarball=<tar-gz-archive>         | optional: the path to a .tar.gz archive that holds the Controller installation or patch tarball
                                       |           if not specified the Controller tarball will be downloaded from the SOS web site
    --patch=<issue-key>                | optional: identifies a patch forfrom a anChange existingManagement Controllerissue installationkey
    --patch-jar=<jar-file>                   | optional: the path to a .jar file that holds the patch
    --license-key=<key-file>           | optional: specifies the path to a license key file to be installed
    --license-bin=<binary-file>        | optional: specifies the path to the js7-license.jar binary file for licensed code to be installed
                                       |           if not specified the file will be downloaded from the SOS web site
    --http-port=<port>                 | optional: specifies the http port the Controller will be operated for, default: 4444
                                                   port can be prefixed by network interface, e.g. localhost:4444
    --https-port=<port>                | optional: specifies the https port the Controller will be operated for
                                                   port can be prefixed by network interface, e.g. batch.example.com:4444
    --pid-file-dir=<directory>         | optional: directory to which the Controller writes its PID file, default: <data>/logs
    --pid-file-name=<file-name>        | optional: file name used by the Controller to write its PID file, default: controller.pid
    --instance-script=<file>           | optional: path to the Instance Start Script that will be copied to the Controller, default <home>/bin/<instance-script>
    --backup-dir=<directory>           | optional: backup directory for existing Controller home directory
    --log-dir=<directory>              | optional: log directory for log output of this script
    --exec-start=<command>             | optional: specifies the command to start the Controller, e.g. 'StartService'
    --exec-stop=<command>              | optional: specifies the command to stop the Controller, e.g. 'StopService'
    --return-values=<file>             | optional: specifies a file that receives return values such as the path to a log file

  Configuration Options:
    --deploy-dir=<directory>           | optional: deployment directory from which configuration files are copied to the Controller
    --controller-conf=<file>           | optional: path to a configuration file that will be copied to <config>/controller.conf
    --private-conf=<file>              | optional: path to a configuration file that will be copied to <config>/private/private.conf
    --controller-primary-cert=<file>   | optional: path to Primary/Standalone Controller certificate file
    --controller-secondary-cert=<file> | optional: path to Secondary Controller certificate file
    --joc-primary-cert=<file>          | optional: path to Primary/Standalone JOC Cockpit certificate file
    --joc-secondary-cert=<file>        | optional: path to Secondary JOC Cockpit certificate file
    --keystore=<file>                  | optional: path to a PKCS12 keystore file that will be copied to <config>/private/
    --keystore-password=<password>     | optional: password for access to keystore
    --keystore-alias=<alias>           | optional: alias name for keystore entry
    --client-keystore=<file>           | optional: path to a PKCS12 client keystore file that will be copied to <config>/private/
    --client-keystore-password=<pass>  | optional: password for access to the client keystore
    --client-keystore-alias=<alias>    | optional: alias name for client keystore entry
    --truststore=<file>                | optional: path to a PKCS12 truststore file that will be copied to <config>/private/
    --truststore-password=<password>   | optional: password for access to truststore
    --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 
    --service-dir=<directory>          | optional: systemd service directory, default: /usr/lib/systemd/system
    --service-file=<file>              | optional: path to a systemd service file that will be copied to <home>/bin/
    --service-name=<identifier>        | optional: name of the systemd service to be created, default js7_controller_<controller-id>

   Switches:
    -h | --help                        | displays usage
    --force-sudo                       | forces use of sudo for operations on directories
    --active                           | makes Controller instance the default active node in a Controller Cluster
    --standby                          | makes Controller instance the default standby node in a Controller Cluster
    --no-install                       | skips Controller installation, performs configuration updates only
    --uninstall                        | uninstalls Controller
    --show-logs                        | shows log output of the script
    --make-dirs                        | creates the specified directories if they do not exist
    --make-service                     | creates the systemd service for the Controller
    --move-libs                        | moves an existing Controller's lib directory instead of removing the directory
    --remove-journal                   | removes an existing Controller's state directory that holds the journal
    --restart                          | stops a running Controller and starts the Controller after installation
    --abort                            | aborts a running Controller if used with the --restart switch
    --kill                             | kills a running Controller if used with the --restart switch

...

  • --home
    • Specifies the directory in which the Controller should be installed.
  • --data
    • Specifies the directory in which the Controller data such as configuration files should be stored.
    • If this option is omitted then the <home>/var directory will be used, see option --home.
  • --config
    • Specifies the directory from which the Controller reads configuration files.
    • By default the <data>/config directory is used, see option --data.
  • --logs
    • Specifies the directory to which the Controller stores log files.
    • By default the <data>/logs directory is used, see option --data.
  • --user
    • Specifies the user account for the Controller daemon.
    • By default the account of the user running the Controller Installation Script is used.
    • Should the the home or data directory be owned by an account that is different from the one running the Controller Installation Script then consider use of the --home-owner and --data-owner options.
  • --home-owner
    • Optionally specifies the user account and group that should own the home directory. By default the home directory is created and owned by the current user account.
    • Syntactically a user account and optionally a group can be specified, for example --home-owner=sos or --home-owner=sos:sos. If the group is not specified then a group with the name of the user account is assumed.
    • Use of this option requires sudo permissions for the user account that runs the Controller Installation Script.
  • --data-owner
    • Optionally specifies the user account and group that should own the data directory. By default the data directory is created and owned by the current user account.
    • Syntactically a user account and optionally a group can be specified, for example --data-owner=sos or --data-owner=sos:sos. If the group is not specified then a group with the name of the user account is assumed.
    • Use of this option requires sudo permissions for the user account that runs the Controller Installation Script.
  • --controller-id
    • Specifies the Controller ID, a unique identifier of the Controller installation. If more than one Controller should be registered with JOC Cockpit then they have to use different Controller IDs.
    • If two Controller instances should work in a Cluster then they have to use the same Controller ID.
  • --release
    • Specifies a release number such as 2.3.1 for download from the SOS web site if the --tarball option is not used.
  • --tarball
    • Optionally specifies the path to a .tar.gz file that holds the Controller installation or patch files. If this option is not used the installation or patch 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 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 Controller'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 a Controller's existing installation directory will be added to a .tar.gz backup file in this directory.
  • --patch-jar
    • Optionally specifies the path to a .jar file that holds the patch if a patch is provided in this format.
  • --license-key
    • Optionally the path to a license key file is specified. Customers with a Commercial License receive the license key file from SOS in .pem or .crt format.
    • For details see JS7 - How to apply a JS7 License Key.
  • --license-bin
    • Optionally the path to the js7-license.jar binary file is specified that includes code that is available for use with a Commercial License only, see JS7 - How to apply a JS7 License Key.
    • Should this option be omitted and a license key file be specified with the --license-key option then the binary file is downloaded from the SOS Web Site, see JS7 - Download.
  • --http-port
    • Specifies the HTTP port that the Controller is operated for. The default value is 4444. The HTTP port is used to specify the value of the JS7_CONTROLLER_HTTP_PORT environment variable in the Controller Instance Start Script.
    • The port can be prefixed by the network interface, for example localhost:4444.
    • When used with the --restart switch the HTTP port is used to identify if the Controller instance is running.
  • --https-port
    • Specifies the HTTPS port that the Controller is operated for. The HTTPS port is specified in the Controller Instance Start Script typically available from ./bin/controller_instance.sh. with the environment variable JS7_CONTROLLER_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:4444.
  • --pid-file-dir
    • Specifies the directory to which the Controller 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 controller.pid is used.
    • The PID file is created in the directory specified by the --pid-file-dir option.
  • --instance-script
    • Specifies the path to a script that acts as the Instance Start Script and that is copied to the bin directory. Typically the name controller_instance.sh. is used. Users are free to choose any name for the script. The script has to be executable for the Controller daemon, see --user. Permissions of the script are not changed by the Controller Installation Script.
    • The Controller Installation Script will perform replacements in the Instance Start Script template for known placeholders such as <JS7_CONTROLLER_USER>, for details see ./bin/controller_instance.sh-example.
  • --backup-dir
    • If a backup directory is specified then an Controller'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_controller.<hostname>.<release>.<yyyy>-<MM>-<dd>T<hh>-<mm>-<ss>.tar.gz
    • For example: backup_js7_controller.centostest_primary.2.3.1.2022-03-19T20-50-45.tar.gz
  • --log-dir
    • If a log directory is specified then the Controller Installation Script will write information about processing steps to a log file in this directory.
    • File names are created according to the pattern: install_js7_controller.<hostname>.<yyyy>-<MM>-<dd>T<hh>-<mm>-<ss>.log
    • For example: install_js7_controller.centostest_primary.2022-03-19T20-50-45.log
  • --exec-start
    • This option can be used should the Controller be started after installation. For example, when using systemd then the option --exec-start="StartService" will start the Controller service 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-start="sudo systemctl start js7_controller".
    • For systemd service files see the JS7 - systemd Service Files for automated Startup and Shutdown with Unix Systems article.
    • This option is an alternative to the use of the --restart switch which starts the Controller from its Instance Start Script. If specified this option will overrule the --restart switch.
  • --exec-stop
    • This option can be used should the Controller be stopped before installation. For example, when using systemd then the option --exec-stop="StopService" will stop the Controller service 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_controller".
    • For systemd service files see the JS7 - systemd Service Files for automated Startup and Shutdown with Unix Systems article.
    • This option is an alternative to the use of the --restart switch which stops the Controller from its Instance Start Script. If specified this option will overrule 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_controller.centostest_primary.2022-03-20T04-54-31.log
      • backup_file=backup_js7_controller.centostest_primary.2.3.1.2022-03-20T04-54-31.tar.gz
    • Any existing file will be overwritten. It is recommended that a unique file name such as /tmp/return.$$.$RANDOM.properties. is used.
    • A value from the file can be retrieved like this:
      • backup=$(cat /tmp/return.$$.$RANDOM.properties | grep "backup_file" | cut -d'=' -f2)

...

Code Block
languagebash
titleExample for use of Controller Installation Script
curl 'https://download.sos-berlin.com/patches/JobScheduler2.2.23-patch/js7_controller_unix.2.2.3-PATCH.JS-1984.tar.gz' \
    -o /tmp/js7_controller_unix.2.2.3-PATCH.JS-1984.tar.gz

./js7_install_controller.sh \
    --tarball=/tmp/js7_controller_unix.2.2.3-PATCH.JS-1984.tar.gz \
    --patch=JS-1984 \
    --home=/home/sos/controller \
    --controller-id=controller \
    --exec-start=StartService \
    --exec-stop=StopService

# downloads the patch tarball from the SOS Web Site using curl
# extracts the patch tarball to the Controller's home directory
# stores the patch files to the Controller's <home>/lib/patches sub-directory
# stops and starts the Controller's systemd service

...

Code Block
languagebash
titleExample for use of Controller Installation Script
curl 'https://download.sos-berlin.com/patches/JobScheduler2.2.2/patch-20220331-JS-1984-3-patch/js7_controller.2.2.3-PATCH.JS-1984.jar' \
    -o /tmp/patch-20220331-JS-1984-js7_controller.2.2.3-PATCH.JS-1984.jar

./js7_install_controller.sh \
    --patch-jar=/tmp/patch-20220331-JS-1984-js7_controller.2.2.3-PATCH.JS-1984.jar \
    --patch=JS-1984 \
    --home=/home/sos/controller \
    --controller-id=controller \
    --exec-start=StartService \
    --exec-stop=StopService

# downloads the patch .jar file from the SOS Web Site using curl
# stores the patch .jar file to the Controller's <home>/lib/patches sub-directory
# stops and starts the Controller's systemd service

...