If you want to resume processing of a user script from a certain marked point (location) within the script, you must include the following synchronization commands in the user script:
initcmdsync(1M) creates a command synchronization descriptor that identifies a particular script and its associated data.
These descriptors are placed in a command synchronization list that determines which user scripts are to be restarted after an automatic failover.
savecmdsync(1M) specifies a marker point from which the script can be restarted.
cancelcmdsync(1M) removes the command synchronization descriptor from the command synchronization list.
Each script must contain the initcmdsync and cancelcmdsync commands to initialize the script for synchronization and then remove the command from the command synchronization list respectively. For details on the synchronization commands, see the cmdsync(1M) man page.
These synchronization commands are intended for use by experienced programmers. You can use the runcmdsync(1M) command instead of the synchronization commands described in this section to prepare a script for recovery. However, the runcmdsync(1M) command will prepare the script so that it is rerun from the beginning and not from specified marker points.
The following procedures describe how to use these synchronization commands.
After an SSP failover or in a single SSP configuration, SSP failover is disabled. When failover is disabled, scripts that contain synchronization commands will generate error messages to the platform log file and return non-zero exit codes. These error messages can be ignored.
In your user script, type the following to create a command synchronization descriptor that identifies your script:
initcmdsync script_name [parameters] |
where:
script_name is the name of the script.
parameters are the options associated with the specified script.
The output returned from the initcmdsync command serves as the command synchronization descriptor.
In your user script, type the following to mark an execution point from which processing can be resumed:
savecmdsync -M identifier cmdsync_descriptor |
where:
identifier is a positive integer that marks an execution point from which the script can be restarted.
cmdsync_descriptor is the command synchronization descriptor output by the initcmdsync command.
In your user script, type the following after the script termination sequence:
cancelcmdsync cmdsync_descriptor |
where cmdsync_descriptor is the command synchronization descriptor output by the initcmdsync command. The specified descriptor is removed from the command synchronization list so that the user script is not run on the new main SSP after a failover.