System Administration Guide: Devices and File Systems

ProcedureHow to Test an RCM Script

  1. Set environment variables, such as RCM_ENV_FORCE, in the command-line shell before running your script.

    For example, in the Korn shell, use the following:

    $ export RCM_ENV_FORCE=TRUE
  2. Test the script by running the script commands manually from the command line.

    For example:

    $ script-name scriptinfo
    $ script-name register
    $ script-name preremove resource-name
    $ script-name postremove resource-name
  3. Make sure that each RCM script command in your script prints appropriate output to stdout.

  4. Install the script in the appropriate script directory.

    For more information, see How to Install an RCM Script.

  5. Test the script by initiating a dynamic remove operation.

    For example, assume your script registers the device, /dev/dsk/c1t0d0s0. Try these commands.

    $ cfgadm -c unconfigure c1::dsk/c1t0d0
    $ cfgadm -f -c unconfigure c1::dsk/c1t0d0
    $ cfgadm -c configure c1::dsk/c1t0d0

    Caution – Caution –

    Make sure that you are familiar with these commands because they can alter the state of the system and cause system failures.