Versions Compared

Key

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

...

Code Block
titleJOC Cockpit Installer Installation Script: js7_install_joc.sh
Usage: js7_install_joc.sh [Options] [Switches]

  Installation Options:
    --setup-dir=<directory>            | optional: directory to which the JOC Cockpit installer will be extracted
    --response-dir=<directory>         | optional: setup response directory holds joc_install.xml and JDBC Drivers
    --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 JOC Cockpit tarball,
                                       |           if not specified the JOC Cockpit tarball will be downloaded from the SOS web site
    --home=<directory>                 | optional: home directory of JOC Cockpit, required if --patch or --backup-dir is used
    --data=<directory>                 | optional: data directory of JOC Cockpit
    --cluster-id=<identifier>          | optional: Cluster ID of the JOC Cockpit instance, default: joc
    --instance-id=<number>             | optional: unique number of a JOC Cockpit instance in a cluster, range 0 to 99, default: 0
    --user=<account>                   | optional: user account for JOC Cockpit daemon, default: joc_install.xml setting
    --patch=<issue-key>                | optional: identifies a patch for an existing JOC Cockpit installation
    --license-key=<key-file>           | optional: specifies the path to a license key file that will 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
    --backup-dir=<directory>           | optional: backup directory for existing JOC Cockpit home directory
    --log-dir=<directory>              | optional: log directory for log output of this script
    --exec-start=<command>             | optional: specifies the command to start JOC Cockpit, e.g. 'StartService'
    --exec-stop=<command>              | optional: specifies the command to stop the JOC Cockpit, 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>[,<dir>]   | optional: deployment directories from which configuration files will be copied to JOC Cockpit
    --properties=<file>                | optional: specifies the joc.properties file that will be copied to <home>/jetty_base/resources/joc/
    --title=<title>                    | optional: title of the JOC Cockpit instance in the GUI, default: joc_install.xml setting
    --security-level=low|medium|high   | optional: security level of JOC Cockpit instance, default: joc_install.xml setting
    --dbms-config=<hibernate-file>     | optional: DBMS Hibernate configuration file, default: joc_install.xml setting
    --dbms-driver=<jdbc-driver-file>   | optional: DBMS JDBC Driver file, default: joc_install.xml setting
    --dbms-init=byInstaller|byJoc|off  | optional: DBMS create objects by installer, on start-up or none, default: joc_install.xml setting
    --http-port=<port>                 | optional: specifies the http port the JOC Cockpit will be operated for, default: 4446
                                                   port can be prefixed by network interface, e.g. localhost:4446
    --https-port=<port>                | optional: specifies the https port the JOC Cockpit will be operated for, default:
                                                   port can be prefixed by network interface, e.g. joc.example.com:4446
    --ini=<ini-file[,ini-file]>        | optional: one or more Jetty config files http.ini, https.ini, ssl.ini etc. will be copied to <home>/jetty_base/start.d/
    --keystore=<path>                  | optional: path to a PKCS12 keystore file that will be copied to <data>/resources/joc/
    --keystore-password=<password>     | optional: password for access to keystore
    --keystore-alias=<alias-name>      | optional: alias name for keystore entry
    --truststore=<path>                | optional: path to a PKCS12 truststore file that will be copied to <data>/resourdes/joc/
    --truststore-password=<password>   | optional: password for truststore password

    --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>/jetty/bin
    --service-name=<name>              | optional: name of the systemd service to be created, default js7_joc

  Switches:
    -h | --help                        | displays usage
    -u | --as-user                     | installs configuration directories as current user, other directories as root using sudo
    -E | --preserve-env                | preserves environment variables when switching to root using sudo -E
    --no-install                       | skips JOC Cockpit installation, performs configuration updates only
    --uninstall                        | uninstalls JOC Cockpit
    --no-jetty                         | skips Jetty servlet container installation
    --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 JOC Cockpit
    --restart                          | stops a running JOC Cockpit and starts JOC Cockpit after installation
    --kill                             | kills a running JOC Cockpit if used with the --restart switch

...

Code Block
titleExample for use of JOC Cockpit Installer Installation Script
linenumberstrue
./js7_install_joc.sh \
    --release=2.5.2 \
    --home=/home/sos/joc \
    --http-port=4446 \
    --dbms-config=/home/sos/joc-deployment/hibernate.cfg.xml \
    --java-home="/opt/java/jdk-11.0.2+9" \
    --as-user \
    --make-dirs

# installs JOC Cockpit for the current user account
# requires that the user creates a hibernate.cfg.xml file for database access prior to installation
# specifies the Java home location
# downloads the JOC Cockpit release tarball from the SOS Web Site
# creates the home directory if it does not exist
# extracts the tarball and runs the JOC Cockpit installer
# operates JOC Cockpit for HTTP port 4446

...

Code Block
titleExample for use of JOC Cockpit Installer Installation Script
linenumberstrue
curl 'https://repo1.maven.org/maven2/com/h2database/h2/1.4.200/h2-1.4.200.jar' -o /tmp/h2-1.4.200.jar

./js7_install_joc.sh \
    --release=2.5.2 \
    --home=/home/sos/joc \
    --http-port=4446 \
    --dbms-driver=/tmp/h2-1.4.200.jar \
    --dbms-config=H2 \
    --java-home="/opt/java/jdk-11.0.2+9" \ 
    --as-user \
    --make-dirs

# downloads the H2 embedded database from Maven Central using curl
# downloads the JOC Cockpit release tarball from the SOS Web Site
# specifies the Java home location
# creates the home directory if it does not exist
# extracts the tarball and runs the JOC Cockpit installer
# operates JOC Cockpit for HTTP port 4446

...

Code Block
titleExample for use of JOC Cockpit Installer Installation Script
linenumberstrue
curl 'https://download.sos-berlin.com/JobScheduler.2.5/js7_joc_linux.2.5.2.tar.gz' -o /tmp/js7_joc_linux.2.5.2.tar.gz

./js7_install_joc.sh \
    --tarball=/tmp/js7_joc_linux.2.5.2.tar.gz \
    --home=/home/sos/joc \
    --http-port=4446 \
    --dbms-config=/home/sos/joc-deployment/hibernate.cfg.xml \
    --java-home="/opt/java/jdk-11.0.2+9" \
    --as-user \
    --make-dirs

# downloads the release tarball from the SOS Web Site using curl
# specifies the Java home location
# creates the home directory if it does not exist
# extracts the tarball and runs the JOC Cockpit installer
# operates JOC Cockpit for HTTP port 4446

...

Code Block
titleExample for use of JOC Cockpit Installer Installation Script
linenumberstrue
./js7_install_joc.sh \
    --release=2.5.2 \
    --home=/opt/sos-berlin.com/js7/joc \
    --data=/var/sos-berlin.com/js7/joc \ 
    --http-port=4446 \
    --dbms-config=/home/sos/joc-deployment/hibernate.cfg.xml \
    --java-home="/opt/java/jdk-11.0.2+9" \
    --as-user \
    --make-dirs

# users might prefer to store configuration data and log data separately from the home directory
# installs JOC Cockpit for the current user account
# requires that the user creates a hibernate.cfg.xml file for database access prior to installation
# specifies the Java home location
# downloads the JOC Cockpit release tarball from the SOS Web Site
# creates the home directory if it does not exist
# extracts the tarball and runs the JOC Cockpit installer
# operates JOC Cockpit for HTTP port 4446

...

Code Block
titleExample for use of JOC Cockpit Installer Installation Script
linenumberstrue
./js7_install_joc.sh \
    --release=2.5.2 \
    --home=/home/sos/joc \
    --http-port=4446 \
    --license-key=/home/sos/example.pem \
    --dbms-config=/home/sos/joc-deployment/hibernate.cfg.xml \
    --java-home="/opt/java/jdk-11.0.2+9" \
    --as-user \
    --make-dirs

# installs JOC Cockpit for the current user account
# requires that the user creates a hibernate.cfg.xml file for database access prior to installation
# specifies the location of the JS7 license key
# specifies the Java home location
# downloads the JOC Cockpit release tarball from the SOS Web Site
# creates the home directory if it does not exist
# extracts the tarball and runs the JOC Cockpit installer
# operates JOC Cockpit for HTTP port 4446

...

Code Block
titleExample for use of JOC Cockpit Installer Installation Script
linenumberstrue
curl 'https://download.sos-berlin.com/JobScheduler.2.5/js7_joc_linux.2.5.2.tar.gz' -o /tmp/js7_joc_linux.2.5.2.tar.gz
curl 'https://download.sos-berlin.com/JobScheduler.2.5/js7-license.jar' -o /tmp/js7-license.jar

./js7_install_joc.sh \
    --tarball=/tmp/js7_joc_linux.2.5.2.tar.gz \
    --home=/home/sos/joc \
    --http-port=4446 \
    --dbms-config=/home/sos/joc-deployment/hibernate.cfg.xml \
    --license-key=/home/sos/joc-deployment/example.pem \
    --license-bin=/tmp/js7-license.jar \
    --java-home="/opt/java/jdk-11.0.2+9" \
    --as-user \
    --make-dirs

# downloads the JOC Cockpit release tarball from the SOS Web Site using curl
# downloads the binary file for licensed code to enable cluster operations using curl
# specifies the location of the JS7 license key
# specifies the Java home location
# creates the home directory if it does not exist
# extracts the tarball and runs the JOC Cockpit installer
# operates JOC Cockpit for HTTP port 4446

...

Code Block
titleExample for use of JOC Cockpit Installer Installation Script
linenumberstrue
curl 'https://download.sos-berlin.com/JobScheduler.2.5/js7_joc_linux.2.5.2.tar.gz' -o /tmp/js7_joc_linux.2.5.2.tar.gz
curl 'https://download.sos-berlin.com/JobScheduler.2.5/js7-license.jar' -o /tmp/js7-license.jar

./js7_install_joc.sh \
    --tarball=/tmp/js7_joc_linux.2.5.2.tar.gz \
    --cluster-id=joc \
    --instance-id=1 \
    --title="Secondary JOC Cockpit" \
    --home=/home/sos/joc \
    --http-port=4446 \
    --dbms-config=/home/sos/joc-deployment/hibernate.cfg.xml \
    --license-key=/home/sos/joc-deployment/example.pem \
    --license-bin=/tmp/js7-license.jar \
    --java-home="/opt/java/jdk-11.0.2+9" \
    --as-user \
    --make-dirs

# downloads the JOC Cockpit release tarball from the SOS Web Site using curl
# downloads the binary file for licensed code to enable cluster operations using curl
# specifies the Cluster ID that is the same for all JOC Cockpit instances in a cluster
# specifies the Instance ID that is a number between 0 and 99:
#   Instance IDs specify the ordering of JOC Cockpit icons in the Dashboard
#   the first JOC Cockpit started becomes the active node in a cluster independent from its Instance ID
# specifies the title that acts as a caption for JOC Cockpit icons in the Dashbaord
# specifies the location of the JS7 license key
# specifies the Java home location
# creates the home directory if it does not exist
# extracts the tarball and runs the JOC Cockpit installer
# operates JOC Cockpit for HTTP port 4446

...

Code Block
titleExample for use of JOC Cockpit Installer Installation Script
linenumberstrue
curl 'https://download.sos-berlin.com/JobScheduler.2.5/js7_joc_linux.2.5.2.tar.gz' -o /tmp/js7_joc_linux.2.5.2.tar.gz

./js7_install_joc.sh \
    --tarball=/tmp/js7_joc_linux.2.5.2.tar.gz \
    --response-dir=/home/sos/joc.response \
    --java-home="/opt/java/jdk-11.0.2+9" \
    --as-user \
    --make-dirs

# downloads the JOC Cockpit release tarball from the SOS Web Site using curl
# specifies a response directory that holds
#    the joc_install.xml file for installation options such as the HTTP Port
#    the hibernate.cfg.xml configuration file for database access
# specifies the Java home location
# creates the home and data directories if they doe not exist
# extracts the tarball and runs the JOC Cockpit installer

...

Code Block
titleExample for use of JOC Cockpit Installer Installation Script
linenumberstrue
curl 'https://download.sos-berlin.com/JobScheduler.2.5/js7_joc_linux.2.5.2.tar.gz' -o /tmp/js7_joc_linux.2.5.2.tar.gz

./js7_install_joc.sh \
    --tarball=/tmp/js7_joc_linux.2.5.2.tar.gz \
    --home=/home/sos/joc \
    --http-port=4446 \
    --dbms-config=/home/sos/joc-deployment/hibernate.cfg.xml \
    --java-home="/opt/java/jdk-11.0.2+9" \ 
    --exec-start="StartService" \
    --exec-stop="StopService" \
    --make-service \
    --as-user \
    --make-dirs

# downloads the JOC Cockpit release tarball from the SOS Web Site using curl
# creates the home directory if it does not exist
# extracts the tarball and runs the JOC Cockpit installer
# creates the JOC Cockpit's systemd service
# stops and starts the JOC Cockpit's systemd service
# operates JOC Cockpit for HTTP port 4446

...

Code Block
titleExample for use of JOC Cockpit Installer Installation Script
linenumberstrue
curl 'https://download.sos-berlin.com/JobScheduler.2.5/js7_joc_linux.2.5.2.tar.gz' -o /tmp/js7_joc_linux.2.5.2.tar.gz

./js7_install_joc.sh \
    --tarball=/tmp/js7_joc_linux.2.5.2.tar.gz \
    --home=/home/sos/joc \
    --http-port=4446 \
    --dbms-config=/home/sos/joc-deployment/hibernate.cfg.xml \
    --java-home="/opt/java/jdk-11.0.2+9" \ 
    --exec-start="sudo systemctl start js7_joc" \
    --exec-stop="sudo systemctl stop js7_joc" \
    --as-user \
    --make-dirs

# downloads the JOC Cockpit release tarball from the SOS Web Site using curl
# creates the home directory if it does not exist
# extracts the tarball and runs the JOC Cockpit installer
# stops and starts the JOC Cockpit by individual commands
# operates JOC Cockpit for HTTP port 4446

...

Code Block
titleExample for use of JOC Cockpit Installer Installation Script
linenumberstrue
curl 'https://download.sos-berlin.com/JobScheduler.2.5/js7_joc_linux.2.5.2.tar.gz' -o /tmp/js7_joc_linux.2.5.2.tar.gz

./js7_install_joc.sh \
    --tarball=/tmp/js7_joc_linux.2.5.2.tar.gz \
    --home=/home/sos/joc \
    --http-port=4446 \
    --dbms-config=/home/sos/joc-deployment/hibernate.cfg.xml \
    --java-home="/opt/java/jdk-11.0.2+9" \
    --restart \
    --as-user \
    --make-dirs

# downloads the JOC Cockpit release tarball from the SOS Web Site using curl
# creates the home directory if it does not exist
# extracts the tarball and runs the JOC Cockpit installer
# stops and starts JOC Cockpit by its instance start script <home>/jetty/bin/jetty.sh
# operates JOC Cockpit for HTTP port 4446

...

Code Block
titleExample for use of JOC Cockpit Installer Installation Script
linenumberstrue
curl 'https://download.sos-berlin.com/JobScheduler.2.5/js7_joc_linux.2.5.2.tar.gz' -o /tmp/js7_joc_linux.2.5.2.tar.gz

./js7_install_joc.sh \
    --tarball=/tmp/js7_joc_linux.2.5.2.tar.gz \
    --home=/home/sos/joc \
    --http-port=4446 \
    --dbms-config=/home/sos/joc-deployment/hibernate.cfg.xml \
    --java-home="/opt/java/jdk-11.0.2+9" \
    --java-options="-Xmx1g -Xms512m" \
    --restart \
    --as-user \
    --make-dirs

# downloads the JOC Cockpit release tarball from the SOS Web Site using curl
# creates the home directory if it does not exist
# specifies Java options for JOC Cockpit
# extracts the tarball and runs the JOC Cockpit installer
# stops and starts JOC Cockpit by its instance start script <home>/jetty/bin/jetty.sh
# operates JOC Cockpit for HTTP port 4446

...

Code Block
titleExample for use of JOC Cockpit Installer Installation Script
linenumberstrue
curl 'https://download.sos-berlin.com/JobScheduler.2.5/js7_joc_linux.2.5.2.tar.gz' -o /tmp/js7_joc_linux.2.5.2.tar.gz
retval=/tmp/js7_install_joc.$$.tmp

./js7_install_joc.sh \
    --tarball=/tmp/js7_joc_linux.2.5.2.tar.gz \
    --home=/home/sos/joc \
    --http-port=4446 \
    --dbms-config=/home/sos/joc-deployment/hibernate.cfg.xml \
    --java-home="/opt/java/jdk-11.0.2+9" \
    --backup-dir=/tmp/backups \
    --log-dir=/tmp/logs \
    --return-values=$retval \
    --as-user \
    --restart \
    --make-dirs

log_file=$(cat $retval | grep "log_file" | cut -d'=' -f2)
backup_file=$(cat $retval | grep "backup_file" | cut -d'=' -f2)

# downloads the JOC Cockpit release tarball from the SOS Web Site using curl
# creates the home directory if it does not exist
# extracts the tarball and runs the JOC Cockpit installer
# stops and starts JOC Cockpit by its instance start script <home>/jetty/bin/jetty.sh
# operates JOC Cockpit for HTTP port 4446
# return values include the path to the log file and to the backup file

...

Code Block
titleExample for use of JOC Cockpit Installer Installation Script
linenumberstrue
curl 'https://download.sos-berlin.com/JobScheduler.2.5/js7_joc_linux.2.5.2.tar.gz' -o /tmp/js7_joc_linux.2.5.2.tar.gz
retval=/tmp/js7_install_joc.$$.tmp

./js7_install_joc.sh \
    --tarball=/tmp/js7_joc_linux.2.5.2.tar.gz \
    --home=/home/sos/joc \
    --http-port=4446 \
    --dbms-config=/home/sos/joc-deployment/hibernate.cfg.xml \
    --java-home="/opt/java/jdk-11.0.2+9" \
    --backup-dir=/tmp/backups \
    --log-dir=/tmp/logs \
    --return-values=$retval \
    --as-user \
    --restart \
    --show-logs \
    --make-dirs
 || ( backup=$(cat $retval | grep "backup_file" | cut -d'=' -f2) \
      && ( test -e "$backup" ) && \
      ./js7_install_joc.sh \
          --tarball=$backup \
          --home=/home/sos/joc \
          --http-port=4446 \
          --dbms-config=/home/sos/joc-deployment/hibernate.cfg.xml \
          --java-home="/opt/java/jdk-11.0.2+9" \
          --log-dir=/tmp/logs \
          --as-user \
          --restart \
          --show-logs )

log_file=$(cat $retval | grep "log_file" | cut -d'=' -f2)
backup_file=$(cat $retval | grep "backup_file" | cut -d'=' -f2)   

# downloads the JOC Cockpit release tarball from the SOS Web Site using curl
# creates the home directory if it does not exist
# extracts the tarball and runs the JOC Cockpit installer
# reverts the installation from the backup archive in case of failure
# stops and starts JOC Cockpit by its instance start script <home>/jetty/bin/jetty.sh
# operates JOC Cockpit for HTTP port 4446

...

Code Block
titleExample for use of JOC Cockpit Installer Installation Script
linenumberstrue
curl 'https://download.sos-berlin.com/JobScheduler.2.5/js7_joc_linux.2.5.2.tar.gz' -o /tmp/js7_joc_linux.2.5.2.tar.gz

./js7_install_joc.sh \
    --tarball=/tmp/js7_joc_linux.2.3.1.tar.gz \
    --home=/home/sos/joc \
    --https-port=4446 \
    --dbms-config=/home/sos/joc-deployment/hibernate.cfg.xml \
    --java-home="/opt/java/jdk-11.0.2+9" \
    --keystore=/home/sos/joc-deployment/https-keystore.p12 \
    --keystore-password="jobscheduler" \
    --truststore=/home/sos/joc-deployment/https-truststore.p12 \
    --truststore-password="jobscheduler" \
    --exec-start="StartService" \
    --exec-stop="StopService" \
    --make-service \
    --as-user \
    --make-dirs \

# downloads the JOC Cockpit release tarball from the SOS Web Site using curl
# creates the home directory if it does not exist
# extracts the tarball and runs the JOC Cockpit installer
# deploys keystore and truststore files
# creates the systemd service
# stops and starts JOC Cockpit by its systemd service
# operates JOC Cockpit for HTTPS port 4446

...

Code Block
titleExample for use of JOC Cockpit Installer Installation Script
linenumberstrue
./js7_install_joc.sh \
    --home=/home/sos/joc \
    --https-port=4446 \
    --java-home="/opt/java/jdk-11.0.2+9" \
    --keystore=/home/sos/joc-deployment/https-keystore.p12 \
    --keystore-password="jobscheduler" \
    --truststore=/home/sos/joc-deployment/https-truststore.p12 \
    --truststore-password="jobscheduler" \
    --exec-start="StartService" \
    --exec-stop="StopService" \
    --no-install

# performs no installation but certificate renewal only
# addresses an existing JOC Cockpit instance operated for HTTPS port 4446
# deploys keystore and truststore files
# stops and starts JOC Cockpit by its systemd service

...

Code Block
titleExample for use of JOC Cockpit Installer Installation Script
linenumberstrue
./js7_install_joc.sh \
    --release=2.2.3 \
    --patch=JS-1984 \
    --home=/home/sos/joc \
    --java-home="/opt/java/jdk-11.0.2+9" \
    --exec-start="StartService" \
    --exec-stop="StopService"
 
# downloads the patch tarball from the SOS Web Site
# extracts the tarball to the JOC Cockpit's data directory assuming that this corresponds to the home directory
# stores the patch files to the JOC Cockpit's <data>/webapps/joc/WEB-INF/classes sub-directory
# stops and starts the JOC Cockpit's systemd service

...

Code Block
titleExample for use of JOC Cockpit Installer Installation Script
linenumberstrue
curl 'https://download.sos-berlin.com/JobScheduler.2.2/js7_joc_linux.2.2.3.JS-1984.tar.gz' -o /tmp/js7_joc_linux.2.2.3.JS-1984.tar.gz
 
./js7_install_joc.sh \
    --tarball=/tmp/js7_joc_linux.2.2.3.JS-1984.tar.gz \
    --patch=JS-1984 \
    --home=/home/sos/joc \
    --java-home="/opt/java/jdk-11.0.2+9" \
    --exec-start="StartService" \
    --exec-stop="StopService"

# downloads the patch tarball from the SOS Web Site using curl
# extracts the tarball to the JOC Cockpit's data directory assuming that this corresponds to the home directory
# stores the patch files to the JOC Cockpit's <data>/webapps/joc/WEB-INF/classes sub-directory
# stops and starts the JOC Cockpit's systemd service

...

Code Block
titleExample for use of JOC Cockpit Installer Installation Script
linenumberstrue
./js7_install_joc.sh \
    --home=/home/sos/joc \
    --java-home="/opt/java/jdk-11.0.2+9" \
    --exec-stop="StopService" \
    --uninstall

# stops the JOC Cockpit's systemd service
# uninstalls JOC Cockpit and removes the home and data directories

...