Start and Stop CABI Services in a non-root installation
search cancel

Start and Stop CABI Services in a non-root installation

book

Article ID: 237599

calendar_today

Updated On:

Products

Spectrum Network Observability

Issue/Introduction

How to Automatically Start/Stop CABI Services in a non-root installation?
 
Start and Stop CABI Services in a non-root installation

Environment

All supported DX NetOps Spectrum releases integrated with Jaspersoft CABI

Resolution

The below steps show a Jasper environment with the following details. Edit them as needed to match your environment.

  • Install User - spectrum
  • $JASPERROOT home install dir: /home/spectrum/CABI

Set up the PostgreSQL service file

  1. Create a file named postgresql.service in the /usr/lib/systemd/system/ directory.
  2. Enter the following content into the file.
    • Edit path and user values as needed to match your environment.
    • Ignore lines of '#' symbols at the top and bottom. They delineate the top and bottom of the file content.

####################################################

# Systemd unit file for postresql
[Unit]
Description=PostgreSQL database server
After=network.target

[Service]
Type=forking

User=spectrum
Group=spectrum

# Maximum number of seconds pg_ctl will wait for postgres to start.  Note that
# PGSTARTTIMEOUT should be less than TimeoutSec value.
Environment=PGSTARTTIMEOUT=270

Environment=PGDATA=/home/spectrum/CABI/postgresql/data

ExecStart=/home/spectrum/CABI/postgresql/bin/pg_ctl start -D ${PGDATA} -s -w -t ${PGSTARTTIMEOUT}
ExecStop=/home/spectrum/CABI/postgresql/bin/pg_ctl stop -D ${PGDATA} -s -m fast
ExecReload=/home/spectrum/CABI/postgresql/bin/pg_ctl reload -D ${PGDATA} -s

# Give a reasonable amount of time for the server to start up/shut down.
# Ideally, the timeout for starting PostgreSQL server should be handled more
# nicely by pg_ctl in ExecStart, so keep its timeout smaller than this value.
TimeoutSec=300

[Install]
WantedBy=multi-user.target

####################################################

Set up the Tomcat service file

  1. Create a file named tomcat.service in the /usr/lib/systemd/system/ directory.
  2. Enter the following content into the file.
    • Edit path and user values as needed to match your environment.
    • Ignore lines of '#' symbols at the top and bottom. They delineate the top and bottom of the file content.

####################################################

# Systemd unit file for tomcat
[Unit]
Description=Apache Tomcat Web Application Container
After=syslog.target network.target

[Service]
Type=forking

Environment=JAVA_HOME=/home/spectrum/CABI/java
Environment=CATALINA_PID=/home/spectrum/CABI/apache-tomcat/temp/tomcat.pid
Environment=CATALINA_HOME=/home/spectrum/CABI/apache-tomcat
Environment=CATALINA_BASE=/home/spectrum/CABI/apache-tomcat
Environment='CATALINA_OPTS=-Xms4096m -Xmx6144m -server -Xss2m -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled'
Environment='JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom'

ExecStart=/home/spectrum/CABI/apache-tomcat/bin/startup.sh
ExecStop=/home/spectrum/CABI/apache-tomcat/bin/shutdown.sh

User=spectrum
Group=spectrum
UMask=0007
RestartSec=10
Restart=always

[Install]
WantedBy=multi-user.target

####################################################

Edit the service.sh file (default path shown)

  • Make a backup copy of the /opt/CA/SC/CABI/service.sh file.
    • cp /opt/CA/SC/CABI/service.sh /opt/CA/SC/CABI/service.sh.orig
  • Open the /opt/CA/SC/CABI/service.sh file for editing.
    • Find this line to be modified.
      • `sed -i "s|/opt/CA/SharedComponents/CA Business Intelligence|$currentDir|g" cabiautostart`
    • Change the line to be:
      • `sed -i "s|/opt/CA/SC/CABI|$currentDir|g" cabiautostart`
  • Save the changes to the file.

Edit the cabiautostart file (default path shown)

  • Make a backup copy of the /opt/CA/SC/CABI/cabiautostart file.
    • cp /opt/CA/SC/CABI/cabiautostart /opt/CA/SC/CABI/cabiautostart.orig
  • Open the /opt/CA/SC/CABI/cabiautostart file for editing.
    • Find this line to be modified.
      • OPATH="/opt/CA/SharedComponents/CA Business Intelligence"
    • Change the line to be:
      • OPATH="/opt/CA/SC/CABI"
  • Save the changes to the file.

Copy the hidden .cabusinessinstalligence file

  • Run the following:
    • cp /root/.cabusinessinstalligence /.cabusinessinstalligence

Reload services, Enable new ones

After the service files are created, after the service.sh and cabiautorestart files are edited  run the below commands in the order given.

  1. systemctl daemon-reload
  2. systemctl enable postgresql
  3. systemctl enable tomcat

Additional Information

This process needs to be configured/supported by the server administrator since this is an Operating System configuration.