You are here: User Guide > Using LifeKeeper Linux > Advanced Tasks > Remove Scripts

Remove Scripts

LifeKeeper executes the remove script for a particular resource type whenever it needs to take a particular instance of that type out of service. This section discusses the remove script for file system type resources found on a LifeKeeper system in the following directory: /opt/LifeKeeper/subsys/gen/Resources/filesys/actions.

The LRACI program that runs the remove script places the resource instance into the OSU state if it completes successfully (exit code 0) and leaves the state unchanged if it fails.

The topic Sections Common to Remove and Restore Scripts highlights the first three sections of the script that are the same in both the remove and the restore scripts. You are encouraged to copy these sections as a starting point for your own script development. The topic Sample Remove Script, providing the functional processing section of a file system remove script, displays the rest of the remove script.

These are the five basic parts of the recovery script:

The script may use either or both of these parameters to determine which specific instance to remove. In this example, the file system remove script uses only the instance_id (the file system mount point). If the instance is a resource type you created, then you would determine the format and meaning of the instance_id. Although the -R parameter is optional, you should always include lines 37-39 in recovery scripts because prfuncs uses the variable RCVARG.

Note the use of the err variable in the script to ensure that the proper exit code is returned to LifeKeeper regardless of termination mode. If the remove script returns a failure exit code (anything other than 0), LifeKeeper stops switchover or failover for the hierarchy involved.

© 2012 SIOS Technology Corp., the industry's leading provider of business continuity solutions, data replication for continuous data protection.