Creating 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 this syntax:

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

    Where

    • package_name – the name of the directory you created

    • companion_name – the name of the companion you are configuring

  2. Edit the package control script to reflect your cluster environment:

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

      VG[0]=""
      

      For example, if the primary companion 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 the primary companion 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 “Editing 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 “Editing 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, enter:

      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, to configure monitoring for primary companion MONEY1, enter:

      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.