uCosminexus Application Server, Operation, Monitoring, and Linkage Guide

[Contents][Glossary][Index][Back][Next]

2.6.5 Settings for automatic stop

In UNIX, Management Server and Administration Agent can be stopped automatically when the host stops.

Organization of this subsection
(1) Settings for automatically stopping Management Server
(2) Settings for automatically stopping Administration Agent

(1) Settings for automatically stopping Management Server

The procedures for specifying the settings for automatically stopping Management Server are described here for each OS.

Note
If you specify settings to automatically restart Management Server, Management Server cannot be stopped by these procedures. Stop the host after stopping each logical server.
Stopping procedures for AIX

The following actions are required to make Management Server stop automatically when the host stops:

  1. Create a script file to make Management Server stop.
  2. Add the processing to make Management Server stop in the /etc/rc.shutdown script.

The following are the methods to create a script file for stopping Management Server, and the methods of adding the stop processing of Management Server to the /etc/rc.shutdown script:

Creating a script file to make Management Server stop
Create a script file for making Management Server stop with any file name under /etc/ (example: /etc/MngSvrStop). Furthermore, set up the authority of the script file to 755.
The following is an example of a script file:
#!/bin/sh
BIN_PATH=/opt/Cosminexus/manager/bin
# Stopping Management Server
if [ -x $BIN_PATH/mngsvrctl ] ; then
  $BIN_PATH/mngsvrctl stop
fi
exit 0
In this example, even if the stop processing fails, the shutdown processing is not interrupted because of the last exit 0. If the shutdown is interrupted when an error occurs, check the return codes after the execution of respective commands and return a return code other than 0.
Note that to stop a logical server when the host stops, add the script that stops the logical server above the script that stops the Management Server.
The following is an example of a script file:
#!/bin/sh
BIN_PATH=/opt/Cosminexus/manager/bin
#Stopping logical server
if [ -x $BIN_PATH/mngsvrutil ] ; then
  $BIN_PATH/mngsvrutil -m mnghost:28080 -u user1 -p user1 -t mnghost -k host -s stop server
fi
# Stopping Management Server
if [ -x $BIN_PATH/mngsvrctl ] ; then
  $BIN_PATH/mngsvrctl stop
fi
exit 0
Specify the various options of the mngsvrutil command in accordance with the operating environment.

Adding the stop processing of Management Server to the /etc/rc.shutdown script
Add the script file that stops Management Server in the /etc/rc.shutdown script as the processing executed using the /etc/rc.shutdown script. When stopping Management Server and Administration Agent on the same host, set up the order so that Management Server stops before Administration Agent stops.
The following is an example of adding the stop processing of Management Server to the /etc/rc.shutdown script. Note that this is an example when the script file that stops Management Server is saved in /etc/MngSvrStop.
if [ -x /etc/MngSvrStop ]; then
  /etc/MngSvrStop
fi
Stopping procedures of HP-UX

The procedures for specifying the settings that stop Management Server automatically when the host stops are described here. Also, the procedures for specifying the settings that stop the logical server automatically when the host stops are described.

Procedures for specifying the settings that stop Management Server automatically when the host stops
For specifying the settings so that Management Server stops automatically when the host stops, create a symbolic link to /sbin/init.d/MngSvr in the/sbin/rc<N>.d directory (<N> shows the execution level when Management Server is stopped). Note that the user with a root authority must create the symbolic link.
Determine the execution level when Management Server is stopped and the order in which Management Server is stopped, which in turn are specified when the symbolic link is created, in accordance with the operating environment. However, when stopping Management Server and Administration Agent on the same host, set up the order so that Management Server stops before Administration Agent stops.
The following is an execution example that stops Management Server automatically. In this example, it is a prerequisite that Management Server is stopped automatically when the execution level changes from 2 to 1.
# ln -s /sbin/init.d/MngSvr /sbin/rc2.d/K800MngSvr
# chmod 755 /sbin/rc2.d/K800MngSvr
Specify the name of the symbolic link in the K<NNN><stop script name> format. Specify a 3-digit numeral that shows the stopping sequence within the same execution level, in <NNN>. Specify the same name as the name of the stop script of the link destination, in stop-script-name. For details on the specification rules of the execution level and the symbolic link, see the OS documentation.

Procedures for specifying the settings that make a logical server stop automatically when the host stops
The following is the procedure for specifying the settings to make a logical server to stop automatically when the host stops:
  1. Create the script file for making a logical server to stop with any file name under /opt/Cosminexus/manager/bin (example: /opt/Cosminexus/manager/bin/LS_stop).
    The following is an example to create a script file:
    #!/bin/sh
    /opt/Cosminexus/manager/bin/mngsvrutil -m mnghost:28080 -u user1 -p user1 -t mnghost -k host -s stop server
    ERROR=$?
    exit $ERROR
    Furthermore, specify the various options of the mngsvrutil command in accordance with the operating environment.
  2. Set the authority of the script file to 755 for a logical server to stop and create a symbolic link to /opt/Cosminexus/manager/bin/MngSvr_LS_stop.
    The following is an execution example:
    # chmod 755 /opt/Cosminexus/manager/bin/LS_stop
    # ln -s /opt/Cosminexus/manager/bin/LS_stop /opt/Cosminexus/manager/bin/MngSvr_LS_stop
    With this, the settings for a logical server to stop automatically when the host stops are complete.
Stopping procedures in Linux

The procedures to specify the settings for Management Server to stop automatically when the host stops are described here. Also, the procedures for specifying the settings for a logical server to stop automatically when the host stops are described.

Note
If the management domain is configured only on the host on which Management Server is stopped, logical servers can be stopped automatically when the host stops. If the management domain is configured on multiple hosts, all the logical servers within the management domain cannot be stopped when Management Server is stopped, and therefore it is necessary to stop the logical servers before stopping Management Server.

Procedures for specifying the settings that stop Management Server automatically when the host stops
For Management Server to stop automatically when the host stops, create a symbolic link to /etc/rc.d/init.d/MngSvr in the /etc/rc.d/rc<N>.d directory (<N> shows the execution level when Management Server is stopped). Note that the user with a root authority must create the symbolic link.
Determine the execution level when Management Server is stopped and the order in which Management Server is stopped, which in turn are specified when the symbolic link is created, in accordance with the operating environment. However, when stopping Management Server and Administration Agent on the same host, set up the order so that Management Server stops before Administration Agent stops.
The following is an execution example for Management Server to stop automatically. In this example, it is a prerequisite that Management Server is stopped automatically when the execution level is 3.
# ln -s /etc/rc.d/init.d/MngSvr /etc/rc.d/rc3.d/K90MngSvr
# chmod 755 /etc/rc.d/rc3.d/K90MngSvr
Specify the name of the symbolic link in the K<NN><stop script name> format. Specify a 2-digit numeral that shows the stopping sequence within the same execution level, in <NN>. Specify the same name as the name of the stop script of the link destination, in stop-script-name. For details on the specification rules of the execution level and the symbolic link, see the OS documentation.

Procedures for specifying the settings that stop a logical server automatically when the host stops
The following is the procedure for specifying the settings for a logical server to stop automatically when the host stops. Note that in this procedure, it is a prerequisite that the management domain is configured only on the host on which Management Server is stopped.
  1. Create the script file for a logical server to stop with any file name under /opt/Cosminexus/manager/bin (example: /opt/Cosminexus/manager/bin/LS_stop).
    The following is an example to create a script file:
    #!/bin/sh
    /opt/Cosminexus/manager/bin/mngsvrutil -m mnghost:28080 -u user1 -p user1 -t mnghost -k host -s stop server
    ERROR=$?
    exit $ERROR
    Furthermore, specify the various options of the mngsvrutil command in accordance with the operating environment.
  2. Set the authority of the script file to 755 for a logical server to stop and create a symbolic link to /opt/Cosminexus/manager/bin/MngSvr_LS_stop.
    The following is an execution example:
    # chmod 755 /opt/Cosminexus/manager/bin/LS_stop
    # ln -s /opt/Cosminexus/manager/bin/LS_stop /opt/Cosminexus/manager/bin/MngSvr_LS_stop
    Furthermore, definitely specify /opt/Cosminexus/manager/bin/MngSvr_LS_stop in the creation destination of the symbolic link.
    With this, the settings for making a logical server to stop automatically when the host stops are complete.
Stopping procedures for Solaris

The procedure for specifying the settings that stop Management Server automatically when the host stops is described here. Also, the procedure for specifying the settings for a logical server to stop automatically when the host stops are described.

Note
If the management domain is configured only on the host on which Management Server is stopped, logical servers can be stopped automatically when Management Server is stopped. If the management domain is configured on multiple hosts, all the logical servers within the management domain cannot be stopped when Management Server is stopped, and therefore it is necessary to stop the logical servers before stopping Management Server.

Procedure for specifying the settings that stop Management Server automatically when the host stops
For Management Server to stop automatically when the host stops, create a symbolic link to /etc/init.d/MngSvr in the /etc/rc<N>.d directory (<N> shows the execution level when Management Server is stopped). Note that the user with a root authority must create the symbolic link.
Determine the execution level when Management Server is stopped and the order in which Management Server is stopped, which in turn are specified when the symbolic link is created, in accordance with the operating environment. However, when stopping Management Server and Administration Agent on the same host, set up the order so that Management Server stops even before Administration Agent stops.
The following is an execution example of making Management Server to stop automatically. In this example, it is a prerequisite that Management Server is stopped automatically when the execution level changes from 2 to 1.
# ln -s /etc/init.d/MngSvr /etc/rc2.d/K90MngSvr
# chmod 755 /etc/rc2.d/K90MngSvr
Specify the name of the symbolic link in the K<NN><stop script name> format. Specify a 2-digit numeral that shows the stopping sequence within the same execution level, in <NN>. Specify the same name as the name of the stop script of the link destination, in stop-script-name. For details on the specification rules of the execution level and the symbolic link, see the OS documentation.

Procedure for specifying the settings that stop a logical server automatically when the host stops
The following is the procedure for specifying the settings for a logical server to stop automatically when the host stops. Note that in this procedure, it is a prerequisite that the management domain is configured only on the host on which Management Server is stopped.
  1. Create the script file for a logical server to stop with any file name under /opt/Cosminexus/manager/bin (example: /opt/Cosminexus/manager/bin/LS_stop).
    The following is an example to create a script file:
    #!/bin/sh
    /opt/Cosminexus/manager/bin/mngsvrutil -m mnghost:28080 -u user1 -p user1 -t mnghost -k host -s stop server
    ERROR=$?
    exit $ERROR
    Furthermore, specify the various options of the mngsvrutil command in accordance with the operating environment.
  2. Set the authority of the script file to 755 for making a logical server to stop and create a symbolic link to /opt/Cosminexus/manager/bin/MngSvr_LS_stop.
    The following is an execution example:
    # chmod 755 /opt/Cosminexus/manager/bin/LS_stop
    # ln -s /opt/Cosminexus/manager/bin/LS_stop /opt/Cosminexus/manager/bin/MngSvr_LS_stop
    Furthermore, definitely specify /opt/Cosminexus/manager/bin/MngSvr_LS_stop in the creation destination of the symbolic link.
    With this, the settings for a logical server to stop automatically when the host stops are complete.

(2) Settings for automatically stopping Administration Agent

The procedure for specifying the settings for automatically stopping Administration Agent are described here for each OS.

Note
If you specify settings to automatically restart Administration Agent, Administration Agent cannot be stopped by these procedures. Stop the host after stopping each logical server.
Stopping procedures for AIX

The following actions are required for Administration Agent to stop automatically when the host stops:

  1. Create a script file for Administration Agent to stop.
  2. Add a processing for Administration Agent to stop in the /etc/rc.shutdown script.

The following are the procedures to create a script file for Administration Agent to stop, and the procedures of adding the stop processing of Administration Agent to the /etc/rc.shutdown script:

Creating a script file for Administration Agent stop
Create the script file that stops Administration Agent with any file name under /etc/ (example: /etc/AdminAgentStop). Furthermore, set the authority of the script file to 755.
The following is an example of a script file:
#!/bin/sh
BIN_PATH=/opt/Cosminexus/manager/bin
# Stopping Administration Agent
if [ -x $BIN_PATH/adminagentctl ] ; then
  $BIN_PATH/adminagentctl stop
fi
exit 0
In this example, even if the stop processing fails, the shutdown processing is not interrupted because of the last exit 0. If the shutdown is interrupted when an error occurs, check the return codes after the execution of respective commands and return a return code other than 0.

Adding the stop processing for Administration Agent to the /etc/rc.shutdown script
Add the script file that makes Administration Agent to stop in the /etc/rc.shutdown script as the processing executed using the /etc/rc.shutdown script.
The following is an example of adding the stop processing of Administration Agent to the /etc/rc.shutdown script. Note that this is an example when the script file for Administration Agent to stop is saved in /etc/AdminAgentStop.
if [ -x /etc/AdminAgentStop]; then
  /etc/AdminAgentStop
fi
Stopping procedures for HP-UX

For Administration Agent to stop automatically when the host stops, create a symbolic link to /sbin/init.d/AdminAgent in the/sbin/rc<N>.d directory (<N> shows the execution level when Administration Agent is stopped). Note that the user with a root authority must create the symbolic link.

Determine the execution level when Administration Agent is stopped and the order in which Administration Agent is stopped, which in turn are specified when the symbolic link is created, in accordance with the operating environment. However, when stopping Administration Agent and Management Server on the same host, set the order so that Management Server stops before Administration Agent stops.

The following is an execution example of making Administration Agent stop automatically. In this example, it is a prerequisite that Administration Agent is stopped automatically when the execution level changes from 2 to 1.

# ln -s /sbin/init.d/AdminAgent /sbin/rc2.d/K900AdminAgent
# chmod 755 /sbin/rc2.d/K900AdminAgent

Specify the name of the symbolic link in the K<NNN>stop-script-name format. Specify a 3-digit numeral that shows the stopping sequence within the same execution level, in <NNN>. Specify the same name as the name of the stop script of the link destination, in stop-script-name. For details on the specification rules of the execution level and the symbolic link, see the OS documentation.

Stopping procedures of Linux

For Administration Agent to stop automatically when the host stops, create a symbolic link to /etc/rc.d/init.d in the /etc/rc.d/rc<N>.d directory (<N> shows the execution level when Administration Agent is stopped). Note that the user with a root authority should create the symbolic link.

Determine the execution level when Administration Agent is stopped and the order in which Administration Agent is stopped, which in turn are specified when the symbolic link is created, in accordance with the operating environment. However, when stopping Administration Agent and Management Server on the same host, set the order so that Management Server stops before Administration Agent stops.

The following is an execution example that stops Administration Agent automatically. In this example, it is a prerequisite that Administration Agent is stopped automatically when the execution level is 3.

# ln -s /etc/rc.d/init.d/AdminAgent /etc/rc.d/rc3.d/K91AdminAgent
# chmod 755 /etc/rc.d/rc3.d/K91AdminAgent

Specify the name of the symbolic link in the K<NN>stop-script-name format. Specify a 2-digit numeral that shows the stopping sequence within the same execution level, in <NN>. Specify the same name as the name of the stop script of the link destination, in stop-script-name. For details on the specification rules of the execution level and the symbolic link, see the OS documentation.

Stopping procedures for Solaris

For Administration Agent to stop automatically when the host stops, create a symbolic link to /etc/init.d in the /etc/rc<N>.d directory (<N> shows the execution level when Administration Agent is stopped). Note that the user with a root authority must create the symbolic link.

Determine the execution level when Administration Agent is stopped and the order in which Administration Agent is stopped, which in turn are specified when the symbolic link is created, in accordance with the operating environment. However, when stopping Administration Agent and Management Server on the same host, set up the order so that Management Server stops before Administration Agent stops.

The following is an execution example for Administration Agent to stop automatically. In this example, it is a prerequisite that Administration Agent is stopped automatically when the execution level changes from 2 to 1.

# ln -s /etc/init.d/AdminAgent /etc/rc2.d/K91AdminAgent
# chmod 755 /etc/rc2.d/K91AdminAgent

Specify the name of the symbolic link in the K<NN>stop-script-name format. Specify a 2-digit numeral that shows the stopping sequence within the same execution level, in <NN>. Specify the same name as the name of the stop script of the link destination, in stop-script-name. For details on the specification rules of the execution level and the symbolic link, see the OS documentation.