How can I start and stop processes that are running under processd in Spectrum?
search cancel

How can I start and stop processes that are running under processd in Spectrum?

book

Article ID: 41428

calendar_today

Updated On:

Products

CA Spectrum DX NetOps

Issue/Introduction

How can I stop and restart processes that are running under processd that have AUTOBOOTSTART set without stopping processd entirely? I am trying to stop a service but processd continues to restart it. I do not want to disable processd. 

Environment

Release: 20.2.x, 21.2.x

Component: SPCCSS - SpectroSERVER Core

Resolution

To manage and control processes that are running under control of CA Spectrum processd service use as Spectrum owner (account) the cmdC and launchinstdbapp executable.

To stop processes that are running under CA Spectrum processd service use cmdC ;  To start processes and use launchinstdbapp

BackGround and Usage

In $SPECROOT/bin you will find cmdC executable that is used under a bash shell in which its purpose is to manage processes that are running under control of the CA Spectrum processd service. The processes could be configured with autorestart automatically by processd. So stopping a CA Spectrum processd subservice via the Operating System is detected by processd which immediately restarts this process/service.

Usage Instructions:

Usage: cmdC <hostname> <function id> <pid num>/<part name>/<outputfile> <absolute path>

 

On the same machine "localhost" is valid. Example: ./cmdC localhost 2 ALARMNOTIFIER NOTIFIER.OUT 

Function ids are:

1 = STOP_TICKET
2 = STOP_AUTO_TICKET
3 = PAUSE_TICKET
4 = CONTINUE_TICKET
5 = REQUEST_TICKET_OUTPUT
6 = GET_ALL_ACTIVE_TICKETS
7 = GET_TICKET_BY_PID
8 = GET_TICKET_BY_PART
9 = GET_INSTALL_TICKET_BY_PART
10 = GET_ALL_INSTALL_TICKETS
11 = ATTACH_TICKET_TO_PROCESS
666 = KILL_ALL_ACTIVE_TICKETS_AND_EXIT
999 = RESTART_PROCESSD


If you want to stop a process there are only two options that you can use:
 

1 = STOP_TICKET
2 = STOP_AUTO_TICKET

If a process is auto-restartable by processd you need to shut it down using option 2. You can determine if the process is auto-restartable by checking the following AUTORESTART variable in the associated .idb file located in the $SPECROOT/lib/SDPM/partslist directory.

For example, the SS.idb has:

#AUTORESTART;N;

The ARCHMGR.idb has:

#AUTORESTART;N;

Both .idb files have this variable set to no but it is commented out so it is not used. This shows you that neither one of these processes is auto-restartable via processd.

In order to stop the processes, you also need to get the PARTNAME of the process. You get the PARTNAME from the associated .idb file as well.

For the SpectroSERVER, the SS.idb has:

PARTNAME;SS;

For ArchMgr, the ARCHMGR.idb has:

PARTNAME;ARCHMGR;

The syntax you would use to stop the ArchMgr:

Step 1:

$SPECROOT/bin/cmdC <hostname> 1 ARCHMGR

Example 1: 

An example of an auto-restartable process is Location Server. In the LOCSERV.idb you see the following:

AUTORESTART;y;

The LOCSERV.idb has the PARTNAME as: PARTNAME;LOCSERV;

The syntax to stop this auto-restartable process would be:

Step 1:

$SPECROOT/bin/cmdC <hostname> 2 LOCSERV

 

Usage Instructions: 

Replace the variable <hostname> with the actual name of the SpectroSERVER - it is also possible to use "localhost".

To start processes that are running under processd once they are stopped use launchinstdbapp executable.

In $SPECROOT/bin you will also find launchinstdbapp executable that is used under a bash shell in which its purpose is to start processes that are running under processd.

Usage:

launchinstdbapp <hostname> <install partname> <autorestart> <logname>

You again need to know the PARTNAME of the process, the output filename (logname) and whether it is auto-restartable or not.

If you are on the same machine as the service, you can use localhost as the <hostname>. 

e.g: ./launchinstdbapp localhost ALARMNOTIFIER y NOTIFIER.OUT

Here is the syntax to use and a few examples:

To start ArchMgr:

$SPECROOT/bin/launchinstdbapp <hostname> ARCHMGR n ARCHMGR.OUT

To start MySQL: 

$SPECROOT/bin/launchinstdbapp <hostname> MYSQL y MYSQL.OUT

To start AlarmNotifier:

$SPECROOT/bin/launchinstdbapp <hostname> ALARMNOTIFIER y NOTIFIER.OUT

Both of these tools will register the processes with processd and start a new ticket or stop an existing ticket. These executables can be used to stop/start other SPECTRUM processes  that are running under processd which can be verified from the $SPECROOT/lib/SDPM/partslist directory by the idb filename. You may have to specify the full path-name and file-name for the output log (i.e. for ARCHMGR.OUT to be still logged to $SEPCROOT/SS/DDM directroy).

Further Information: 

Sample for partname - for all running "services" currently active under control of "CA Spectrum processd" service:

$ ./cmdC localhost 6 | egrep -w 'auto_restart|part_name' 

ticket auto_restart        = 1
ticket part_name          = MYSQL
ticket auto_restart        = 1
ticket part_name          = NAMINGSERVICE
ticket auto_restart        = 1
ticket part_name          = TELNETD
ticket auto_restart        = 1
ticket part_name          = LOCSERV
ticket auto_restart        = 1
ticket part_name          = NCMSERV
ticket auto_restart        = 0
ticket part_name          = VNMSHD
ticket auto_restart        = 0
ticket part_name          = SS
ticket auto_restart        = 0
ticket part_name          = REXCON
ticket auto_restart        = 0
ticket part_name          = ARCHMGR
ticket auto_restart        = 1
ticket part_name          = TOMCAT



Sample for stopping TOMCAT:

Step 1:

$ ./cmdC `hostname` 2 TOMCAT

DATE OF THIS REQUEST

ticket function id        = 267
ticket cb function id     = 256
ticket exchange id        = 4
ticket more data           = 0
......

 

Additional Information

to add the trace to notifier without stopping processd

1. Please ensure that the SPECROOT/lib/SDPM/partslist/ALARMNOTIFIER.idb file has the trace added 

ARGV;$SPECROOT/Notifier/AlarmNotifier<CSEXE> -tl details;

2. use from SPECROOT/bin

/cmdC localhost 1 ALARMNOTIFIER

this will stop notifier and let it restart via processd. There is no need to manually restart it.  Verify that it is running as follows:

 ps -ef  |grep -i alarm
spectrum    6837    1315  0 09:48 ?        00:00:00 /usr/Spectrum/Notifier/AlarmNotifier -tl details

alternatively....

if we just want to stop it and not let processd restart it, use

/cmdC localhost 2 ALARMNOTIFIER

to restart via processd manually use

./launchinstdbapp localhost ALARMNOTIFIER  y NOTIFIER.OUT