wpar_reg_script Command

Purpose

Allows a user to register scripts to be run during different phases of a system WPAR live application mobility. Currently, only the WPAR restart phase is supported.

Syntax

/usr/lib/wpars/wpar_reg_script [ -r | -u ] [ -p phase] [ -s /path/to/script ]

Description

The wpar_reg_script command allows a user to register scripts to be run during specific phases of WPAR live application mobility.

Registering a script will place an entry in a new ODM class called CuWscr that contains the full path to the script and its arguments.

This script can be used with kernel extensions and mobility to load kernel extensions on the arrival node before other processes start.

Restrictions

The wpar_reg_script command can only be run from inside a WPAR.

Only the file systems that are part of the WPARs config are available at the time of execution (not privately mounted file systems). These file systems are only available read-only.

No processes can be left running when the script exits.

Loading kernel extensions with this script for use with mobility is restricted to SYS_SINGLELOAD.

Flags

Item Description
-r Register an entry including its script and phase to the CuWscr class.
-u Unregister an entry from the CuWscr class.
-p The phase that the command will be executed during. Value of 1 corresponds to WPAR restart. More may be added in the future. If no value is specified, it will use a default value of 1.
-s The path to the script and its arguments that will be executed. Surround the full command with "" to include command line parameters.

Examples

  1. To register the script /usr/sbin/foo/ to execute:
    /usr/lib/wpars/wpar_reg_script -r -s /usr/sbin/foo
  2. To register the script /usr/sbin/foo/ with arguments:
    /usr/lib/wpars/wpar_reg_script -r -s "/usr/sbin/foo args"
  3. To Unregister all instances of the script /usr/sbin/foo/ foo:
    /usr/lib/wpars/wpar_reg_script -u -s /usr/sbin/foo
  4. To unregister all scripts that run during phase 1:
    /usr/lib/wpars/wpar_reg_script -u -p 1