Linux FailSafe   Programmer's Guide

Written by Joshua Rodman of SuSE, Inc. and Lori Johnson of SGI

Illustrated by Dany Galgani and Chris Wengelski

Production by Diane Ciardelli and Adrian Daley

Engineering contributions by Rusty Ballinger, Franck Chastagnol, Jeff Hanson, Vidula Iyer, Herbert Lewis, Michael Nishimoto, Hugh Shannon Jr., Bill Sparks, Paddy Sreenivasan, Dan Stekloff, Rebecca Underwood, Mayank Vasa, and Manish Verma

Legal Notice
Table of Contents
About This Guide
1. Audience
2. Related Documentation
3. Conventions Used in This Guide
1. Introduction to Writing Application Scripts
1.1. Concepts
1.2. Highly Available Services Included with Linux FailSafe
1.3. Plug-Ins
1.4. Characteristics that Permit an Application to be Highly Available
1.5. Overview of the Programming Steps
2. Writing the Action Scripts and Adding Monitoring Agents
2.1. Set of Action Scripts
2.2. Understanding the Execution of Action Scripts
2.3. Preparation
2.4. Script Format
2.5. Steps in Writing a Script
2.6. Examples of Action Scripts
2.7. Monitoring Agents
3. Creating a Failover Policy
3.1. Contents of a Failover Policy
3.2. Failover Script Interface
3.3. Example Failover Policies for Linux FailSafe
4. Defining a New Resource Type
4.1. Using the GUI
4.2. Using cluster_mgr Interactively
4.3. Using cluster_mgr With a Script
4.4. Testing a New Resource Type
5. Testing Scripts
5.1. General Testing and Debugging Techniques
5.2. Debugging Notes
5.3. Testing an Action Script
5.4. Special Testing Considerations for the monitor Script
A. Starting the FailSafe Manager
B. Using the SRM Script Library
B.1. Linux FailSafe application interfaces
B.2. Set Global Definitions
B.3. Check Arguments
B.4. Read an Input File
B.5. Execute a Command
B.6. Write Status for a Resource
B.7. Get the Value for a Field
B.8. Get the Value for Multiple Fields
B.9. Get Resource Information
B.10. Print Exclusivity Check Messages
Glossary
Index
List of Tables
1-1. Example Resource Group
2-1. Differences Between the monitor and exclusive Action Scripts
2-2. Successful Action Script Results
2-3. Failure of an Action Script
3-1. Required Failover Attributes (mutually exclusive)
3-2. Optional Failover Attributes (mutually exclusive)
4-1. Order Ranges
4-2. Resource Type Order Numbers
List of Figures
2-1. Monitoring Process
3-1. N+1 Configuration Concept
3-2. N+2 Configuration Concept
3-3. N+M Configuration Concept
4-1. Select Define a New Resource
4-2. Specify the Name of the New Resource Type
4-3. Specify Settings for Required Actions
4-4. Change Settings for Optional Actions
4-5. Set Type-specific Attributes
4-6. Add Dependencies
A-1. FailSafe Manager