Automatically Start and Shut Down Products on UNIX Systems by Registering Daemons

Overview: This article describes how to register daemons for Software AG products on UNIX systems and to make those products start and stop automatically at system start and shutdown time. For almost all products, registering as daemons can be done at the installation time, but if missed the registering daemons during installation then after installing the products also it’s possible. After installation, we can use the command line tool daemon.sh to register daemons for more Software AG products.

To start and stop products automatically at system start and shutdown time we can register daemons for Software AG products on UNIX systems. For almost all products, registering of daemons are done during the installation time, as shown below

But if have missed the about step during installation then after installation, we can use the command line tool daemon.sh to register daemons for Software AG products. The daemon.sh is located in the <Software AG_ install dir> /common/bin directory.

To register daemons logon to the system as the root user and navigate to the <Software AG_ install dir> /common/bin directory and use the daemon.sh command to register daemons for Software AG products as shown below with an example.

Ex: bash-4.4$ ./daemon.sh –f   <Software AG install dir> /profiles/IS_default/bin/sagis105"

[daemon.sh] Created /etc/sagis105 (ok)

[daemon.sh] chmod 775 /etc/sagis105 (ok)

[daemon.sh] /usr/sbin/mkitab "sagis105:235:wait:/etc/sagis105 start ..." (ok)

And also we can use this tool to unregister daemons for Software AG product.

Ex:bash-4.4$ ./daemon.sh -r -f <Software AG install dir> /profiles/IS_default/bin/sagis105"

[daemon.sh] /usr/sbin/rmitab sagis105 (ok)

[daemon.sh] /etc/sagis105 removed (ok)

The daemon.sh script generates an init-script for each daemon. The naming convention for the init-script is sag[number]instance, where sag is a fixed prefix string, and instance is a unique identifier for the daemon instance. If you accidentally specify a nonunique instance during daemon registration, the daemon.sh script automatically adds number to make the init-script name unique.

The table below shows the locations of init-scripts generated by the daemon.sh script.

System

Location

AIX

/etc

SLES 11, Solaris

/etc/init.d

HP-UX

/sbin/init.d

Mac OSX

/Library/LaunchDaemons

When using the daemon.sh -f option to register or unregister a daemon, make sure to use the absolute path name. Below is an example that applies to most products.

Ex : daemon.sh -f Software AG_directory/optimize/analysis/bin/sagoptiAE.sh

For products which can have multiple instances, such as Universal Messaging,Integration Server, Integration Agent, and My webMethods Server, the command has an additional option, -n instance. The command to use for Universal Messaging, for example, is as follows.

Ex: bash-4.4$./daemon.sh  -n um -f  "<Install_dir>/UniversalMessaging/server/umserver/bin/nserverdaemon"

[daemon.sh] Created /etc/sagum (ok)

[daemon.sh] chmod 775 /etc/sagum (ok)

[daemon.sh] /usr/sbin/mkitab "sagum:235:wait:/etc/sagum start ..." (ok)

bash-4.4$./daemon.sh –n um –r –f  "<Install_dir>/UniversalMessaging/server/umserver/bin/nserverdaemon"

[daemon.sh] /usr/sbin/rmitab sagum (ok)

[daemon.sh] /etc/sagnserverdaemon removed (ok)

Below section shows how to register and unregister the Software AG products:

Integration Server:

  Register:

  bash-4.4$./daemon.sh  -f  "<Install_dir>/profiles/IS_default/bin/sagis105"

  [daemon.sh] Created /etc/sagis105 (ok)

  [daemon.sh] chmod 775 /etc/sagis105 (ok)

  [daemon.sh] /usr/sbin/mkitab "sagis105:235:wait:/etc/sagis105 start ..." (ok)

  Unregister:

  bash-4.4$./daemon.sh  -r  -f "<Install_dir>/profiles/IS_default/bin/sagis105"

  [daemon.sh] /usr/sbin/rmitab sagis105 (ok)

  [daemon.sh] /etc/sagis105 removed (ok)

Analytical Engine:

  Register:

  bash-4.4$./daemon.sh  -f  "<Install_dir>/optimize/analysis/bin/sagoptiAE.sh"

  [daemon.sh] Created /etc/sagoptiAE (ok)

  [daemon.sh] chmod 775 /etc/sagoptiAE (ok)

  [daemon.sh] /usr/sbin/mkitab "sagoptiAE:235:wait:/etc/sagoptiAE start ..." (ok)

  Unregister:

  bash-4.4$./daemon.sh  -r  -f "<Install_dir>/optimize/analysis/bin/sagoptiAE.sh"

  [daemon.sh] /usr/sbin/rmitab sagoptiAE (ok)

  [daemon.sh] /etc/sagoptiAE removed (ok)

DataCollector:

  Register:

  bash-4.4$./daemon.sh  -f  "<Install_dir>/optimize/dataCollector/bin/sagoptiDC.sh"

  [daemon.sh] Created /etc/sagoptiDC (ok)

  [daemon.sh] chmod 775 /etc/sagoptiDC (ok)

  [daemon.sh] /usr/sbin/mkitab "sagoptiDC:235:wait:/etc/sagoptiDC start ..." (ok)

  Unregister:

  bash-4.4$./daemon.sh  –r  –f  "<Install_dir>optimize/dataCollector/bin/sagoptiDC.sh"

  [daemon.sh] /usr/sbin/rmitab sagoptiDC (ok)

  [daemon.sh] /etc/sagoptiDC removed (ok)

SPM:

  Register:

  bash-4.4$./daemon.sh  -f  "<Install_dir>/profiles/SPM/bin/sagspm104"

  [daemon.sh] Created /etc/sagspm104 (ok)

  [daemon.sh] chmod 775 /etc/sagspm104 (ok)

  [daemon.sh] /usr/sbin/mkitab "sagspm104:235:wait:/etc/sagspm104 start ..." (ok)

  Unregister:

  bash-4.4$./daemon.sh  -r  -f  "<Install_dir>/profiles/SPM/bin/sagspm104"

  [daemon.sh] /usr/sbin/rmitab sagspm104 (ok)

  [daemon.sh] /etc/sagspm104 removed (ok)

CentraSite:

  Register:

  bash-4.4$./daemon.sh  -f  "<Install_dir>/CentraSite/bin/saginm"

  [daemon.sh] Created /etc/saginm (ok)

  [daemon.sh] chmod 775 /etc/saginm (ok)

  [daemon.sh] /usr/sbin/mkitab "saginm:235:wait:/etc/saginm start ..." (ok)

  Unregister:

  bash-4.4$./daemon.sh  -r  -f  "<Install_dir>/CentraSite/bin/saginm"

  [daemon.sh] /usr/sbin/rmitab saginm (ok)

  [daemon.sh] /etc/saginm removed (ok)

Universal Messaging:

  Register:

  bash-4.4$./daemon.sh -n um -f        

  "<Install_dir>/UniversalMessaging/server/umserver/bin/nserverdaemon"

  [daemon.sh] Created /etc/sagum (ok)

  [daemon.sh] chmod 775 /etc/sagum (ok)

  [daemon.sh] /usr/sbin/mkitab "sagum:235:wait:/etc/sagum start ..." (ok)

  Unregister:

  bash-4.4$./daemon.sh –n um –r –f    

  "<Install_dir>/UniversalMessaging/server/umserver/bin/nserverdaemon"

  [daemon.sh] /usr/sbin/rmitab sagum (ok)

  [daemon.sh] /etc/sagnserverdaemon removed (ok)

One Data:

  Register:

  bash-4.4$./daemon.sh  -f  "<Install_dir>/profiles/ODE/bin/sagode104"

  [daemon.sh] Created /etc/sagode104 (ok)

  [daemon.sh] chmod 775 /etc/sagode104 (ok)

  [daemon.sh] /usr/sbin/mkitab "sagode104:235:wait:/etc/sagode104 start ..." (ok)

  Unregister:

  bash-4.4$./daemon.sh  -r -f "<Install_dir>/profiles/ODE/bin/sagode104"

  [daemon.sh] /usr/sbin/rmitab sagode104 (ok)

  [daemon.sh] /etc/sagode104 removed (ok)

Infrastructure Data Collector:

  Register:

  bash-4.4$./daemon.sh -f "/FS/fs0677/testenv/Daemon/profiles/InfraDC/bin/sagwid104"

  [daemon.sh] Created /etc/sagwid104 (ok)

  [daemon.sh] chmod 775 /etc/sagwid104 (ok)

  [daemon.sh] /usr/sbin/mkitab "sagwid104:235:wait:/etc/sagwid104 start ..." (ok)

  Unregister:

  bash-4.4$./daemon.sh  -r  -f  "<Install_dir>/profiles/InfraDC/bin/sagwid104"

  [daemon.sh] /usr/sbin/rmitab sagwid104 (ok)

  [daemon.sh] /etc/sagwid104 removed (ok)

To list all registered daemons that have prefix sag then command line option daemon.sh  –L is used.

For example:

bash-4.2$./daemon.sh -L

/etc/sag1mws912_default_1 <Install_dir>/profiles/MWS_default/bin/sagmws912_default_1

/etc/sag1spm100          <Install_dir>/profiles/SPM/bin/sagspm100

/etc/sag1spm101          <Install_dir>/profiles/SPM/bin/sagspm101

/etc/sag1spm102          <Install_dir>/profiles/SPM/bin/sagspm102

/etc/sag1spm103          <Install_dir>/profiles/SPM/bin/sagspm103

/etc/sag1spm104          <Install_dir>/profiles/SPM/bin/sagspm104

/etc/sag1spm912          <Install_dir>/profiles/SPM/bin/sagspm912

/etc/sag2spm104          <Install_dir>/profiles/SPM/bin/sagspm104