Starting CA Harvest SCM As A Service on Linux
search cancel

Starting CA Harvest SCM As A Service on Linux

book

Article ID: 39420

calendar_today

Updated On:

Products

CA Harvest Software Change Manager - OpenMake Meister

Issue/Introduction

Introduction: 

The CA Harvest SCM Broker and Agent components are normally started from a command prompt window and will execute until they are manually shut down or the computer restarts.  After restarting the computer, you would normally need to open a new command prompt window and start these components again manually.  In a production environment this is not always practical or convenient, so the Harvest SCM Administrator must devise a way to have these components automatically restart if the computer is shut down and restarted.  This article describes one way to accomplish this type of configuration on a Linux operating system.

Background:  

The example scripts shown here assume the default installation of CA Harvest SCM where all components are installed to the folders indicated in the Implementation Guide and the userid created to “own” the CA Harvest SCM installation folders is named “cascm”.  Your environment may differ in some of these details and if so you should adjust the scripts accordingly.  You will need root access to your Harvest SCM Broker computer and a knowledge of Unix shell scripting concepts to implement these suggestions.

It is simplest if all these steps are executed as the “root” user.

Environment

CA Harvest SCM on the Linux platform

Resolution

Instructions: 

  1. Create a script to set the environment for CA Harvest SCM

-      Use the “vi” editor to create a file called "/home/cascm/set_cascm_env.sh" (click the link to see the example script)

-      Set permissions on this file to make it executable

chmod –R 755 /home/cascm/set_cascm_env.sh

-      Set ownership of this file to the “cascm” user

chown -R cascm:cascm /home/cascm/set_cascm_env.sh

  1. Create scripts to perform all the actions needed during startup and shutdown

-      Create a directory "/home/cascm/scripts" in which to store the new scripts

-      Use the “vi” editor to create a file called “/home/cascm/scripts/startbroker.sh” (click the link to see the example script)

-      Use the “vi” editor to create a file called “/home/cascm/scripts/stopbroker.sh” (click the link to see the example script)

-      Use the “vi” editor to create a file called “/home/cascm/scripts/startagent.sh” (click the link to see the example script)

-      Use the “vi” editor to create a file called “/home/cascm/scripts/stopagent.sh” (click the link to see the example script)

-      Set permissions on this folder to make the scripts executable and the resulting log file writable

chmod –R 755 /home/cascm/scripts

-      Set ownership of this folder and its contents to the “cascm” user

chown -R cascm:cascm /home/cascm/scripts

  1. Create the service controller script

-      Use the “vi” editor to create a file called “/etc/init.d/cascm” (click the link to see the example script)

-      Set permissions on this file to make it executable

chmod 750 /etc/init.d/cascm

-      Register the service with the operating system

chkconfig --add cascm

  1. Test the service

-      To start the service:

service cascm start

-      To stop the service:

service cascm stop

Additional Information

NOTE: These example script files are saved in "Unix" format and may be best viewed on a Windows platform with Wordpad, Notepad++ or Textpad.)

NOTE: The example scripts included with this article are offered on an as-is basis and are not guaranteed to work on every platform and version.  They are distributed with the understanding that they will be used at your own risk. Additionally we recommend you test thoroughly in a sandbox test environment before implementing in production.

Attachments

1654629451220__Linux cascm auto start scripts.txt get_app