Go to main content

Managing Devices in Oracle® Solaris 11.4

Exit Print View

Updated: November 2020
 
 

Reconfiguration Coordination Manager (RCM) Script Overview

The Reconfiguration Coordination Manager (RCM) is the framework that manages the dynamic removal of system components. By using RCM, you can register and release system resources in an orderly manner.

    The RCM script feature simplifies and better controls the DR process. By creating an RCM script, you can do the following:

  • Automatically release a device when you dynamically remove a device. This process also closes the device if the device is opened by an application.

  • Run site-specific tasks when you dynamically remove a device from the system.

  • Write customized scripts to perform other shutdown operations when a reconfiguration request is received that affects the resources that are registered in the script.


Note -  The cfgadm -f command can force a reconfiguration operation. However, this command might leave applications in an unknown state. Manually releasing resources from applications commonly causes errors so avoid using this syntax to perform reconfigurations.

About RCM Scripts

An RCM script can be any of the following script types:

  • An executable shell script (Perl, sh, csh, or ksh) or binary program that the RCM daemon runs. Perl is the recommended language.

  • A script that runs in its own address space by using the user ID of the script file owner.

  • A script that is run by the RCM daemon when you use the cfgadm command to dynamically reconfigure a system resource.

You can use an RCM script to release a device from an application when you dynamically remove a device. If the device is currently open, the RCM script also closes the device. For example, an RCM script for a tape backup application can inform the tape backup application to close the tape drive or shut down the tape backup application.

You run an RCM script using the following syntax:

$ script-name command [args ...]

An RCM script performs the following basic steps:

  1. Gets the RCM command from command-line arguments.

  2. Runs the command.

  3. Writes the results to stdout as name-value pairs.

  4. Exits with the appropriate exit status.

The RCM daemon runs one instance of a script at a time. If a script is running, the RCM daemon does not run the script until the first script exits.

RCM Script Commands

    You must include the following RCM commands in an RCM script:

  • scriptinfo – Gathers script information

  • register – Registers interest in resources

  • resourceinfo – Gathers resource information

    The following RCM commands are optional:

  • queryremove – Queries whether the resource can be released

  • preremove – Releases the resource

  • postremove – Provides post-resource removal notification

  • undoremove – Reverses the actions done in the preremove operation

For a complete description of these RCM commands, see the rcmscript(5) man page.

    When you dynamically remove a device, the RCM daemon runs the following commands:

  • The script's register command, which gathers the list of resources (device names) that are identified in the script.

  • The script's queryremove and preremove commands prior to removing the resource if the script's registered resources are affected by the dynamic remove operation.

  • The script's postremove command if the remove operation succeeds. However, if the remove operation fails, the RCM daemon runs the script's undoremove command.

RCM Script Directories

    You store RCM scripts in locations by their use:

  • Scripts for specific systems – /etc/rcm/scripts

  • Scripts for a specific hardware implementation – /usr/platform/`uname -i`/lib/rcm/scripts

  • Scripts for a specific hardware class – /usr/platform/`uname -m`/lib/rcm/scripts

  • Scripts for any hardware – /usr/lib/rcm/scripts