Configuring SCM to auto-start on Linux
search cancel

Configuring SCM to auto-start on Linux

book

Article ID: 229639

calendar_today

Updated On:

Products

CA Harvest Software Change Manager

Issue/Introduction

How to configure an auto-start utility for SCM so that the broker can start automatically once the server is rebooted

Environment

CA Harvest SCM

Release : 14.0 and up

 

Resolution

Here is an example of how this can be done on a Redhat Linux 7.x or 8.x server

1. Login as the userid that owns the Harvest SCM software folder and set up the start and stop scripts

Example:
mkdir ~/scripts
# Copy all lines from "cat >" to "EOF" and paste as one block.
cat > ~/scripts/startup.sh <<EOF
#!/bin/bash
/opt/CA/scm/bin/bkrd
ps -ef | grep scm
EOF

# Copy all lines from "cat >" to "EOF" and paste as one block.
cat > ~/scripts/shutdown.sh <<EOF
#!/bin/sh
. /opt/CA/pec/bin/rtinit.sh
/opt/CA/pec/bin/i86_64_linux24/rtserver.x -stop_all
ps -ef | grep scm
EOF

2. Adjust write and execute permissions to enable the scripts to run.

Example:
chmod -R a+w ~/scripts
chmod a+x ~/scripts/*.sh

3. To test the scripts, try to start the broker to see if it runs.  Run a command line utility to confirm it can connect.

Example:
cd ~/scripts
./startup.sh
ps -ef | grep scm
hgetusg -b `hostname` -usr harvest -pw harvest -cu ; cat hgetusg.log

4. The final step to set up the auto-start service must be performed as the root user.

Example:
exit
# Copy all lines from "cat >" to "EOF" and paste as one block.
cat > /etc/systemd/system/harvest.service <<EOF
# Invoking SCM scripts to start/shutdown

[Unit]
Description=CA Harvest SCM server
Requires=network.target

[Service]
Type=forking
Restart=no
# On these next 4 lines, change every occurrence of "cascm" to the Linux userid that owns the Harvest software folder.
ExecStart=/home/cascm/scripts/startup.sh
ExecStop=/home/cascm/scripts/shutdown.sh
User=cascm
Group=cascm
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
EOF

5. Enable and start the service.

Example:
systemctl daemon-reload
systemctl status harvest
systemctl enable harvest

6. To test, reboot the Harvest server, then login and check to see if the Harvest processes are up and running.

Example:
ps -ef | grep 'bkrd\|hserver\|rtserver'