|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
1. Managing Removable Media (Overview) 2. Managing Removable Media (Tasks) 3. Accessing Removable Media (Tasks) 4. Writing CDs and DVDs (Tasks) 5. Managing Devices (Overview/Tasks) 6. Dynamically Configuring Devices (Tasks) Dynamic Reconfiguration and Hot-Plugging SCSI Hot-Plugging With the cfgadm Command (Task Map) SCSI Hot-Plugging With the cfgadm Command How to Display Information About SCSI Devices How to Unconfigure a SCSI Controller How to Configure a SCSI Controller How to Configure a SCSI Device How to Disconnect a SCSI Controller SPARC: How to Connect a SCSI Controller SPARC: How to Add a SCSI Device to a SCSI Bus SPARC: How to Replace an Identical Device on a SCSI Controller SPARC: How to Remove a SCSI Device How to Resolve a Failed SCSI Unconfigure Operation PCI or PCIe Hot-Plugging With the cfgadm Command (Task Map) PCI or PCIe Hot-Plugging With the cfgadm Command How to Display PCI Slot Configuration Information How to Remove a PCI Adapter Card Reconfiguration Coordination Manager (RCM) Script Overview 7. Using USB Devices (Overview) 9. Using InfiniBand Devices (Overview/Tasks) 11. Administering Disks (Tasks) 12. SPARC: Adding a Disk (Tasks) 13. x86: Adding a Disk (Tasks) 14. Configuring Solaris iSCSI Targets and Initiators (Tasks) 15. Configuring and Managing the Solaris Internet Storage Name Service (iSNS) 16. The format Utility (Reference) 17. Managing File Systems (Overview) 18. Creating UFS, TMPFS, and LOFS File Systems (Tasks) 19. Mounting and Unmounting File Systems (Tasks) 20. Using The CacheFS File System (Tasks) 21. Configuring Additional Swap Space (Tasks) 22. Checking UFS File System Consistency (Tasks) 23. UFS File System (Reference) 24. Backing Up and Restoring File Systems (Overview) 25. Backing Up Files and File Systems (Tasks) 26. Using UFS Snapshots (Tasks) 27. Restoring Files and File Systems (Tasks) 28. UFS Backup and Restore Commands (Reference) 29. Copying UFS Files and File Systems (Tasks) |
RCM Script TasksThe following sections describe the RCM script tasks for application developers and system administrators. Application Developer RCM Script (Task Map)The following task map describes the tasks for an application developer who is creating an RCM script.
System Administrator RCM Script (Task Map)The following task map describes the tasks for a system administrator who is creating an RCM script to do site customization.
Naming an RCM ScriptA script must be named as vendor,service where the following applies:
Installing or Removing an RCM ScriptYou must be superuser (root) to install or remove an RCM script. Use this table to determine where you should install your RCM script. Table 6-1 RCM Script Directories
How to Install an RCM Script
How to Remove an RCM Script
How to Test an RCM Script
Tape Backup RCM Script ExampleThis example illustrates how to use an RCM script for tape backups. What the Tape Backup RCM Script DoesThe tape backup RCM script performs the following steps:
Outcomes of the Tape Backup Reconfiguration ScenariosHere are the various outcomes if you use the cfgadm command to remove a tape device without the RCM script.
Here are the various outcomes if you use the cfgadm command to remove a tape device with the RCM script.
Example—Tape Backup RCM Script#! /usr/bin/perl -w
#
# A sample site customization RCM script.
#
# When RCM_ENV_FORCE is FALSE this script indicates to RCM that it cannot
# release the tape drive when the tape drive is being used for backup.
#
# When RCM_ENV_FORCE is TRUE this script allows DR removing a tape drive
# when the tape drive is being used for backup by killing the tape
# backup application.
#
use strict;
my ($cmd, %dispatch);
$cmd = shift(@ARGV);
# dispatch table for RCM commands
%dispatch = (
"scriptinfo" => \&do_scriptinfo,
"register" => \&do_register,
"resourceinfo" => \&do_resourceinfo,
"queryremove" => \&do_preremove,
"preremove" => \&do_preremove
);
if (defined($dispatch{$cmd})) {
&{$dispatch{$cmd}};
} else {
exit (2);
}
sub do_scriptinfo
{
print "rcm_script_version=1\n";
print "rcm_script_func_info=Tape backup appl script for DR\n";
exit (0);
}
sub do_register
{
my ($dir, $f, $errmsg);
$dir = opendir(RMT, "/dev/rmt");
if (!$dir) {
$errmsg = "Unable to open /dev/rmt directory: $!";
print "rcm_failure_reason=$errmsg\n";
exit (1);
}
while ($f = readdir(RMT)) {
# ignore hidden files and multiple names for the same device
if (($f !~ /^\./) && ($f =~ /^[0-9]+$/)) {
print "rcm_resource_name=/dev/rmt/$f\n";
}
}
closedir(RMT);
exit (0);
}
sub do_resourceinfo
{
my ($rsrc, $unit);
$rsrc = shift(@ARGV);
if ($rsrc =~ /^\/dev\/rmt\/([0-9]+)$/) {
$unit = $1;
print "rcm_resource_usage_info=Backup Tape Unit Number $unit\n";
exit (0);
} else {
print "rcm_failure_reason=Unknown tape device!\n";
exit (1);
}
}
sub do_preremove
{
my ($rsrc);
$rsrc = shift(@ARGV);
# check if backup application is using this resource
#if (the backup application is not running on $rsrc) {
# allow the DR to continue
# exit (0);
#}
#
# If RCM_ENV_FORCE is FALSE deny the operation.
# If RCM_ENV_FORCE is TRUE kill the backup application in order
# to allow the DR operation to proceed
#
if ($ENV{RCM_ENV_FORCE} eq 'TRUE') {
if ($cmd eq 'preremove') {
# kill the tape backup application
}
exit (0);
} else {
#
# indicate that the tape drive can not be released
# since the device is being used for backup by the
# tape backup application
#
print "rcm_failure_reason=tape backup in progress pid=...\n"
;
exit (3);
}
}
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
|