Hitachi

uCosminexus Application Server Command Reference Guide


D.4 How to terminate a system

This section explains how to terminate each process of configuration software, resources, and J2EE applications.

Organization of this subsection

(1) Terminating a Web server

For details on terminating a Web server, see the manual on the Web server you are using.

Note that the timing of terminating a Web server depends on the form of system operation, but you can first terminate the Web server for controlling the reception of requests in the J2EE application.

(2) Terminating a J2EE application

This point explains how to terminate a J2EE application.

You terminate a J2EE application with server management commands. To stop J2EE application, use the cjstopapp server management command.

Note that you must have the root permission, or the permission of the Component Container Administrator to execute server management commands.

In some cases the request processing within a J2EE application does not finish even when the J2EE application is terminated, and hence, the termination processing is not complete. In such cases, you need to terminate the J2EE application forcefully. For forceful termination of a J2EE application, specify the -force option in the cjstopapp command, and then execute the command.

For specific procedures for terminating J2EE applications, see 10.2.2 Stopping J2EE applications in the uCosminexus Application Server Application Setup Guide.

(3) Terminating a resource

This point explains how to terminate a resource.

You terminate a resource using the server management command (cjstoprar or cjstopjb).

Note that you must have root permission or Component Container administrator permission to execute the server management commands.

When you use a resource adapter included in the J2EE application, this operation is not required.

Important note
  • When you want to terminate DB Connector for Cosminexus RM, terminate the Cosminexus RM in advance. If you try to terminate DB Connector for Cosminexus RM without terminating the Cosminexus RM, an error will occur.

  • A J2EE resource for which an optional name is defined cannot be terminated when a J2EE application is running on the J2EE server. If you try to terminate the J2EE resource, a message will be output and the processing will fail. For terminating the J2EE resource for which an optional name is specified, terminate all the J2EE applications running on the J2EE server, and then terminate the J2EE resource.

(4) Terminating a J2EE server

To terminate a J2EE server:

  1. Move the current directory using the cd command.

    # cd /opt/Cosminexus/CC/server/bin
  2. Terminate the J2EE server using the cjstopsv command.

    You must have the root permission (when the Component Container Administrator is not set) or permission of Component Container Administrator (when the Component Container Administrator is set) for executing the command.

    # cjstopsv server-name

An example for executing the cjstopsv command is explained below. In this example, the server name is 'MyServer'.

# cd /opt/Cosminexus/CC/server/bin
# cjstopsv MyServer
#

Note that in some cases the processing on the J2EE server does not finish even when the J2EE server is terminated, and hence, the termination processing is not complete. In such cases, you must terminate the J2EE server forcefully. To forcefully terminate a J2EE server, specify the -f option or -fd option in the cjstopsv command, and then execute the command. If you specify the -fd option, the J2EE server is terminated forcefully after acquiring the failure information of the J2EE server.

Caution

If the CORBA Naming Service is invoked automatically, it will also terminate automatically when you terminate the J2EE server.

(5) Terminating a CTM daemon

To terminate a CTM daemon:

  1. Move the current directory using the cd command.

    # cd /opt/Cosminexus/CTM/bin
  2. Terminate the CTM daemon using the ctmstop command.

    # ctmstop

Note that in some cases even after you terminate the CTM daemon, the termination processing of the CTM daemon does not finish. In such cases, you must terminate the CTM daemon forcibly. For forceful termination of the CTM daemon, specify the -CTMForce option in the ctmstop command, and then execute the command.

(6) Terminating the CORBA Naming Service

The procedure for terminating the CORBA Naming Service differs depending on how the CORBA Naming Service is invoked.

The details of the procedure for terminating the CORBA Naming Service when it is invoked manually in the background are explained below.

When you invoke the CORBA Naming Service manually in the background, it is not discriminated from other Java processes, and you may not understand which process is the CORBA Naming Service. As a result, how to acquire the process ID of the CORBA Naming Service differs depending on the existence of other active Java processes. Note that in AIX, if you execute the ps -ef command, the process arguments are displayed longer than in other platforms, and therefore, you can identify the CORBA Naming Service.

When no other Java process is running
  1. Acquire the process ID of CORBA Naming Service.

    # ps -ef | grep java
  2. Specify the acquired process ID, and terminate the CORBA Naming Service.

    # kill Process-ID-of-CORBA-Naming-Service
When other Java processes are running
  1. Acquire the process ID of CORBA Naming Service.

    If you use the shell script for invoking the CORBA Naming Service, you can output the process ID of CORBA Naming Service in the namesv_pid file that is generated in the current working directory.

    An example of the shell script for invoking the CORBA Naming Service is illustrated below:

    #!/bin/sh
    export VBROKER_ADM=/opt/Cosminexus/TPB/adm
    export SHLIB_PATH="${SHLIB_PATH}:/opt/Cosminexus/TPB/lib"
     
    # start name server process
    exec /opt/Cosminexus/TPB/bin/nameserv \
    -J-Dvbroker.agent.enableLocator=false \
    -J-Djava.security.policy==/opt/Cosminexus/CC/server/sysconf/cli.policy \
    -J-Dvbroker.se.iiop_tp.scm.iiop_tp.listener.port=900 &
     
    # save background java process pid
    echo $! > ./namesv_pid

    Note that the underscored strings are OS-specific variable names. In AIX, they are replaced by LIBPATH. In Linux, they are replaced by LD_LIBRARY_PATH.

  2. Specify the acquired process ID, and terminate the CORBA Naming Service.

    # kill 'cat namesv_pid'

(7) Terminating the CTM domain manager

To terminate CTM domain manager:

  1. Move the current directory using the cd command.

    # cd /opt/Cosminexus/CTM/bin
  2. Terminate the CTM domain manager using the ctmdmstop command.

    # ctmdmstop

Note that in some cases even after you terminate the CTM domain manager, the termination processing of the CTM domain manager does not finish. In such cases, you must terminate the CTM domain manager forcibly. For forceful termination of the CTM domain manager, specify the -CTMForce option in the ctmdmstop command, and then execute the command.

(8) Terminating the Smart Agent

The procedure for terminating the Smart Agent is as follows:

The method of terminating the Smart Agent will differ depending on how you started the Smart Agent.

When the Smart Agent is started manually at the foreground

Terminate with the Ctrl + C key.

When the Smart Agent is started manually at the background

To terminate the Smart Agent:

  1. Acquire the process ID of the Smart Agent.

    # ps -ef | grep osagent
  2. Specify the acquired process ID, and terminate the Smart Agent.

    # kill smart-agent-process-ID

(9) Terminating a PRF daemon

To terminate a PRF daemon:

  1. Move the current directory using the cd command.

    # cd /opt/Cosminexus/PRF/bin
  2. Terminate the PRF daemon using the cprfstop command.

    # cprfstop

Note that in some cases even after you terminate the PRF daemon, the termination processing of the PRF daemon does not finish. In such cases, you must terminate the PRF daemon forcefully. For forceful termination of the PRF daemon, specify the -Force option in the cprfstop command, and then execute the command.