Stop the TEMS, TEPS or Agents during AIX Shutdown

Technote (FAQ)


Question

How can you stop the TEMS, TEPS and Agents cleanly during shutdown on AIX?

Answer

Overview

On AIX systems, the shutdown command kills running ITM processes instead of stopping them normally. On rare occasions, shutdown may lead to verify index errors in one or more TEMS database files and a requirement to recreate them as logically empty files. This disruption to normal processing requires assistance from IBM Support.

An immediate solution is to stop all ITM processes before invoking shutdown. That will eliminate the issue by a simple change in procedure. Of course that is essentially manual with all the negatives involved.

The following process augments AIX shutdown to stop the TEMS and other ITM components automatically. This has had limited testing and should be tested carefully before using in production.

This additional action *not* needed on other Linux/Unix platforms to stop ITM components at system shutdown..

AIX Shutdown Process

The shutdown command runs a user supplied shell script named /etc/rc.shutdown. AIX runs this script before it kills running processes. You can use this script to stop ITM components normally using itmcmd. Note that the changes to /etc/rc.shutdown do not check whether the TEMS or other ITM components are already running. Since itmcmd already does this, there is no need for the script to do so.

For more complete information about /etc/rc.shutdown, refer to AIX documentation on the shutdown command:

http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.cmds/doc/aixcmds5/shutdown.htm

It is recommended that you use the sample script supplied with this technote rather than adding itmcmd invocations directly to /etc/rc.shutdown. This will allow the ITM components to be stopped using the same user and command syntax that they were started with. For the rest of the instructions, we will use the name /etc/rc.itm_stop as the name of the sample script.

If /etc/rc.shutdown exists

If you already have a working /etc/rc.shutdown, add the rc.itm_stop incantation that stops your TEMS and other ITM components:

    /etc/rc.itm_stop CANDLEHOME

In the above case, CANDLEHOME is your ITM installation directory. CANDLEHOME is optional if you use the default installation directory /opt/IBM/ITM, or if you modify the script to specify your common installation directory as the default.

The sample script ends with an exit status of zero. Do not change this.

If /etc/rc.shutdown does not exist

If you do not have an /etc/rc.shutdown script, create one with the following content:

    #!/bin/ksh
    /etc/rc.itm_stop CANDLEHOME
    exit 0

In the above case, CANDLEHOME is your ITM installation directory. CANDLEHOME is optional if you use the default installation directory /opt/IBM/ITM, or if you modify the script to specify your common installation directory as the default.

After you've created the file, set its ownership and permission:

    chown root:system /etc/rc.shutdown
    chmod 755 /etc/rc.shutdown

The sample script ends with an exit status of zero. Do not change this.

Testing /etc/rc.shutdown

To test the change when using the sample script /etc/rc.itm_stop, use the shutdown command to halt the operating system while the TEMS and/or other ITM components are running. Then, after you've restarted the system, look for the directory /tmp/IBM/ITM/logs for the logs generated by the /etc/rc.itm_stop script.

Implementing the solution on an enterprise level

To implement the above solution on an enterprise level would involve using the following tacmd commands:
tacmd login
tacmd listsystems
tacmd getfile
tacmd putfile
tacmd executecommand

Documentation for release 6.23 FP001 of the tacmd commands can be found here.
http://pic.dhe.ibm.com/infocenter/tivihelp/v15r1/index.jsp?topic=%2Fcom.ibm.itm.doc_6.2.3%2Fitm623_cmdref11.htm&path%3D3_1_5_0_3

To use "tacmd getfile", "tacmd putfile", or "tacmd executecommand", the KT1_TEMS_SECURE configuration parameter must be set in the hub monitoring server's configuration file to specify that the hub monitoring server supports this command. The default value is no. Specify Y or YES or y or yes if you want to use these commands.

On a Windows system, the configuration file is:
\install_dir\cms\KBBENV.
On a Linux/Unix system, both the configuration files are:
/install_dir/config/hostname_ms_TEMSNAME.config
/install_dir/config/ms.ini

    where install_dir is your ITM installation directory
    hostname is the local host name
    TEMSNAMEis the name of the TEMS

After setting the environment variable, you must recycle the hub monitoring server.

Before using the other tacmd commands you must use "tacmd login" to log into the Monitoring Server.

If you do not know which nodes are the AIX nodes, you can use commands similar to these to determine the platform for each node.
tacmd listsystems -t UX
tacmd executecommand -m NODE -v -o -c "uname -sn" | grep -v KUIEXC

    where NODE is any one of the nodes returned by the "tacmd listystems" command.

NOTE: The Unix OS agent must be running as root in order for you to be able to create, modify or put files in the /etc directory on the required endpoints..

You can use "tacmd putfile" to push the sample rc.itm_stop file to the required endpoints.

    NOTE: If you use an ITM installation directory on AIX that is different than the default location of /opt/IBM/ITM, you may want to modify the rc.itm_stop script before you push it to the endpoints. You can change the following line in the rc.itm_stop script to specify the desired ITM installation directory:
    itm_home=/opt/IBM/ITM

Sample tacmd putfile command:
tacmd putfile -m NODE -s /tmp/etc/rc.itm_stop -d /etc/rc.itm_stop -t text
    where NODE is any one of the nodes returned by the "tacmd listystems" command which you have determined to be an AIX platform..

You can use "tacmd getfile" to pull the rc.shutdown file from the required endpoints to determine what change needs to be performed.
Sample tacmd getfile command:
tacmd getfile -m NODE -s /etc/rc.shutdown -d /tmp/<NODE>_rc.shutdown -t text

    where NODE is any one of the nodes returned by the "tacmd listystems" command which you have determined to be an AIX platform..

If you receive the following message, then the /etc/rc.shutdown file does not exist on the endpoint:
KUIPTF201E: Local file name does not exist.

You may be able to use "tacmd executecommand" to make the changes to the /etc/rc.shutdown file on the required endpoints.

If /etc/rc.shutdown does not exist on the endpoint, commands similar to these can create it:
tacmd executecommand -v -o -c "/usr/bin/echo \"#\!/bin/ksh\n/etc/rc.itm_stop\nexit 0\" > /etc/rc.shutdown" -m NODE
tacmd executecommand -v -o -c "chown root:system /etc/rc.shutdown" -m NODE
tacmd executecommand -v -o -c "chmod 755 /etc/rc.shutdown" -m NODE

    where NODE is any one of the nodes returned by the "tacmd listystems" command which you have determined to be an AIX platform.

If /etc/rc.shutdown already exists on the endpoint, you must examine the file that you pulled to determine whether you can safely modify the file remotely. If appending the rc.itm_stop invocation to the end of the file is safe, a command similar to this can be used to modify it:
tacmd executecommand -v -o -c "/usr/bin/echo \"\n\n/etc/rc.itm_stop\nexit 0\" >> /etc/rc.shutdown" -m NODE

    where NODE is any one of the nodes returned by the "tacmd listystems" command which you have determined to be an AIX platform.

Summary

This document shows how to ensure the TEMS and other ITM components are stopped normally during AIX system shutdown.

If you have implemented this solution and want to inform IBM, please give feedback on this technical note including contact information such as an email address. The contact information is required since the technote feedback process is anonymous. Contact information is never required, but if you need interaction it is needed.


Appendix - Sample shutdown script

Attached to this technote is tar file containing a sample shutdown script.

    rc.itm_stop.tar tar file containing rc.itm_stop shutdown script.
    rc.itm_stop stops the TEMS and any other ITM components started by the startup script.
The tar file has the following cksum result on AIX and other Unix/Linux systems:
# cksum rc.itm_stop.tar
3927144294 10240 rc.itm_stop.tar

If your cksum result is different, it is likely that you have transported the file in ASCII mode instead of in Binary mode. You will need to re-transport the file in Binary mode.

There have been no identified cases of a failure to shutdown TEPS or the agents causing any problems but a planned shutdown makes it cleaner for all ITM components. Otherwise the logic has to go through a timeout detection process which at least takes longer.

The sample script makes two assumptions:

    1. A shutdown log is created in /tmp/ibm_itm/logs for later review.
    2. ITM is installed in the default location of /opt/IBM/ITM. You can override the ITM installation directory by specifying it on the rc.itm_stop invocation added to the rc.shutdown file, or by modifying the rc.itm_stop to specify your common installation directory as the default.

In general you should not have to modify the rc.itm_stop script supplied unless you want to change the default ITM installation directory specified in the script.

Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

Tivoli Components
ITM Tivoli Enterprise Mgmt Server V6

Software version:

All Versions

Operating system(s):

AIX

Software edition:

All Editions

Reference #:

1598557

Modified date:

2013-03-20

Translate my page

Machine Translation

Content navigation