Migrating packages from legacy to modular style

5
Package Environment Variables
You can add variables to the package using PEVs. PEVs allow attributes to be added to the modular package
configuration file. cmviewcl’s -f line displays the packages’ PEVs and their value. PEVs are passed as environment
variables to any external scripts that you add to the package. Define these attributes in the package configuration file
using the prefix “PEV_” (uppercase with an underscore as shown).
For example, if a legacy package control script has the variable APP_DIRECTORY, the corresponding variable in the
package configuration file would be PEV_APP_DIRECTORY:
PEV_APP_DIRECTORY /var/opt/app
You can add your own custom scripts to the package definition using two well-defined entry points: external_script and
external_pre_script. Any PEVs you define are passed into the script when it is executed.
In the example above, the environment variable PEV_APP_DIRECTORY with the value of “/var/opt/app” would be passed
to the external script. All environment variables are passed to the scripts in uppercase.
For more information about user-created scripts and PEVs, see the Managing Serviceguard manuals for
HP-UX servers
and Linux servers.
Package migration
Overview
The following sections describe the migration of different types of packages, and provide instructions for migrating
legacy packages to modular packages.
The high-level steps are:
1. Determine the profile of the package from the tables that follow.
2. Determine from the package profile if the package can be migrated using the cmmigratepkg or cmeasymigrate
command.
a. If it cannot be migrated using cmmigratepkg, then follow instructions in the section on Manual steps for
migrating a package.
b. If it can be migrated using cmmigratepkg or cmeasymigrate:
i. Check the control script for changed or obsolete functions.
ii. Select the options for the cmmigratepkg or cmeasymigrate migration tool and migrate the package following
the examples for the profile that matches this package.
Package profiles
As a first step, use the below table to determine the profile of the legacy package you want to migrate:
The following table describes the package profiles that can be migrated using the automated tool: cmmigratepkg.
Profile Description
Simple Package A failover package that does not have any additional code in the customer-defined user area of the
control script, and whose package control script does not have any non-Serviceguard variables
defined or used.
Package with Customer
Defined Script
A failover package whose control script’s customer-defined area has code which invokes another
script or includes functions that are not a part of the Serviceguard control script template.
Package With control script
with variables defined
A failover package whose package control script defined has user-defined environment variables
that are not Serviceguard parameters.
Package with Dependencies A package that depends on another package. The package can be converted to a modular package
and the package which it depends upon can remain a legacy package.