Create the package control script

The package control script contains the information necessary to:

For security reasons, the control script must reside in a directory that includes cmcluster in its path.

Each package requires a separate control script. The control script placed in the package subdirectory under /etc/cmcluster is given the same name that it has in the package configuration file. It must be executable.

Perform the following as root:

  1. Use the cmmakepkg utility to generate a package control script template for the primary companion in the same directory you created. The cmmakepkg utility uses the following syntax:

    /usr/sbin/cmmakepkg -s /etc/cmcluster/package_name/companion_name.cntl
    

    where package_name is the name of the directory you created and companion_name is the name of the companion you are configuring.

    For example, to create a package control script for primary companion MONEY1:

    /usr/sbin/cmmakepkg -s /etc/cmcluster/MONEY1/MONEY1.cntl
    
  2. Edit the package control script to reflect your cluster environment

Follow the steps below to edit your package control script:

  1. Define the volume groups that are used by this companion server package:

    VG[0]=""
    

    For example, if primary companion MONEY1 uses volume group ha_vg1, enter the following:

    VG[0]="ha_vg1"
    
  2. If you are using a shared file system, define the logical volumes and file system in the following line in the FILESYSTEMS section of the script:

    LV[0]="";FS[0]="", FS_MOUNT_OPT[0]="-Fvxfs -o rw, suid, log, mincache, dync, blkclear, detainlog, largefiles"
    

    For example, if primary companion MONEY1 has data on a ha_fs1 file system on logical volume ha_lv1:

    LV[0]="ha_lv1";FS[0]="/ha_fs1", FS_MOUNT_OPT[0]=""
    
  3. Enter the command to halt the companion service inside the customer_defined_halt_cmds function. This command includes the location of the ASE_HA.sh file (described in “Edit the ASE_HA.sh script”). Before editing, this section looks similar to:

    function customer_defined_halt_cmds
    {
    # ADD customer defined run commands.
    : # do nothing instruction, because a function must contain some command.
    
    test_return 52
    }
    

    Edit the function to include the halt command. For example, to include the halt command for companion MONEY1:

    function customer_defined_halt_cmds
    {
    # ADD customer defined run commands.
    : # do nothing instruction, because a function must contain some command.
    
    /etc/cmcluster/MONEY1/MONEY1.sh halt
    test_return 52
    }
    
  4. Move to the START OF CUSTOMER DEFINED FUNCTIONS section of companion_name.cntl and enter the command to start the companion service. Enter this command inside the customer_defined_run_cmds function. This command includes the location of the ASE_HA.sh file (described in “Edit the ASE_HA.sh script”). Before editing this section looks similar to:

    function customer_defined_run_cmds
    {
    # ADD customer defined run commands.
    : # do nothing instruction, because a function must contain some command.
    
    test_return 51
    }
    

    Edit the function to include the start command. For example, to include the start command for companion MONEY1:

    function customer_defined_run_cmds
    {
    # ADD customer defined run commands.
    : # do nothing instruction, because a function must contain some command.
    
    /etc/cmcluster/MONEY1/MONEY1.sh start
    test_return 51
    }
    
  5. Define the script that monitors the server process as a service in the SERVICE NAMES AND COMMANDS section of the script:

    SERVICE_NAME[0]=""
    SERVICE_CMD[0]=""
    SERVICE_RESTART[0]=""
    

    For example, configure monitoring for primary companion MONEY1:

    SERVICE_NAME[0]="MONEY1"
    SERVICE_CMD[0]="/etc/cmcluster/MONEY1/MONEY1.sh monitor"
    SERVICE_RESTART[0]="-R"
    
  6. Distribute the script to each node in the cluster. For example, to distribute the script to the secondary node HUM1:

    # rcp /etc/cmcluster/MONEY1/MONEY1.cntl HUM1:/etc/cmcluster/MONEY1/MONEY1.cntl
    
  7. Repeat these steps for the secondary companion.