You are here: Administration > Man Pages > LCD(1M)



LCD(1M) — miscellaneous LifeKeeper programs for LCD component


LKROOT/bin/lcdremexec [-e] -d destname [-t remotetimeout] -- cmd [arg1 arg2 arg3 ... argn]

LKROOT/bin/lcdstatus [-d destname] [-q] [-e] [-r root-tag] [-u]

LKROOT/bin/lcdsync [-d destname]

LKROOT/bin/lcdlockf filename process_id


LKROOT/bin/lcdrecover -g {remove|restore|delete} - [arg1 arg2 ... argn] |-G {remove|restore|delete} -- [arg1 arg2 ... argn] | -p primarytest [-oresource]

LKROOT/bin/lcdrcp file1 file2 file3 ... {dest:ofile | dest:odir}

LKROOT/bin/lkstart [-w waitperiod]

LKROOT/bin/lkstop [-f|-n|-r]



These programs have various uses by application developers. They are all found in the directory $LKROOT/bin.


 lcdremexec [-e] -d destname [-t remotetimeout] -- cmd [arg1 arg2 arg3 ...argn]

This program sends a remote request over the LifeKeeper communication paths to the system destname, to execute the command cmd remotely with arguments arg1 arg2 arg3 ... argn and returns the stdout and stderr of the remote command to stdout of the lcdremexec command. The exit code of the remote command is exited by lcdremexec. Note that if destname is the current system, no messages are sent; lcdremexec performs a Unix execvp(2) call of the command by passing the string cmd arg1 arg2 arg3 ... argn to the /bin/ksh shell using the -c option executing it locally.

The -e option will split stdout and stderr of the remote command and first print stdout of the remote command to stdout of lcdremexec, then print stderr of the remote command to stderr of the lcdremexec command. This option has no effect for local commands, which have their stdout and stderr unchanged.

The -t option can be used to set a timeout interval for the remote response. If this is not specified, the value of remotetimeout in /etc/defaults/LifeKeeper is used (essentially infinity).

lcdstatus [-d destname] [-q] [-e] [-r root-tag] [-u]

This program will print to stdout the current status of all of the LifeKeeper resource hierarchy configuration and communication path data on system destname (or the current system, if not specified). The -q and -e options give short reports. The -q option lists the local system on which each resource is defined. The -e option lists the backup system (next system in priority failover order) for each resource. The -r option limits a report to a specific resource root-tag. The -u options suppresses duplicate resource entries in the lcdstatus -q or -e output.

A typical example of output from a lcdstatus -e command is shown below:


BACKUP    TAG                        ID                   STATE   PRIO   PRIMARY

svr1         appfs3910-on-svr1 appfs4238      ISP      1         svr2

svr1          filesys4083              /jrl1               ISP      1         svr2

svr1          device2126             000...300-1    ISP      1         svr2

svr1          disk2083                 000...300       ISP      1         svr2

-------     ipeth0- IP-  ISP     10        svr1


svr1            TCP         ALIVE      1

svr1            TCP         ALIVE      2


Resource Information:

BACKUP - the next system in the failover priority order, after the system for which the status display pertains. If target system is the lowest priority system for a given resource, the BACKUP column for that resource contains dashes (for example, -------).


TAG - tag name for each resource. Root resources are shown in an accented color. Tag names of resources within the hierarchy are indented appropriately to indicate dependency relationships between resources.


ID - each resource's identifier string.


STATE - current state of each resource. Possible values are:

   ISU - In-service locally, but local recovery will not be attempted.

   OSF - Out-of-service, failed.

   OSU - Out-of-service, unimpaired.


The PRIO column contains the failover priority value of the local server, for each resource.

The PRIMARY column contains the name of the server with the highest priority, for each resource.


Communications Status Information:

MACHINE - remote machine name for the communications path.

NETWORK - the type of communications path (TCP or TTY).

DEVICE - the device name for the communications path.

STATE - the state of the communications path (ALIVE or DEAD).

PRIO - For TCP paths, the assigned priority of the path. For TTY paths, this column will contain dashes (---), since TTY paths do not have an assigned priority.

lcdsync [-d destname]

This program checks to see if the LifeKeeper resource hierarchy configuration and communication path status data stored in shared memory has been modified. If it is different, the data is "synchronously" written to disk. Therefore, when this program returns, the data is guaranteed to be on disk properly. If destname is not specified, the current system is assumed.

Note that the commands that are used to modify resource hierarchy configurations or communication paths (such as ins_create, dep_create, ins_setinit, net_create, eqv_remove, ...) only modify the shared memory segment and are not reflected in the permanent file storage of LifeKeeper, until the lcdsync program is run.

lcdlockf filename process_id

This program may be used to provide serialization of portions of shell scripts which may have multiple instances executing simultaneously. In particular, it is used within recovery scripts which support parallel recovery, but which have specific segments of script code which must be serialized.

The first argument filename is the name of a unique file which will be used to provide the locking mechanism. The file itself will be created by lcdlockf, so the only requirement is that the chosen filename be unique to the calling script. The second argument process_id is the process ID of the calling script, normally provided using the $$ shell variable. This argument is used by other calling instances of the script to ensure that the process which establishes a lock is still alive.

Once lcdlockf has established a lock, the lock can be removed by simply removing the unique lock file which was provided as the first argument to lcdlockf.

Example usage:

 lcdlockf /tmp/lockxyz$$

         script statements to be serialized

         rm -f/tmp/lockxyz


This program will return the current name of the local system.

lcdrecover -g {remove|restore|delete} -- [arg1 arg2 ... argn] | -G{remove|restore|delete} -- [arg1 arg2 ... argn] | -p primarytest | [-oresource]

The -p option for lcdrecover is used to determine if a particular resource is on a resource hierarchy that is on the primary system or the secondary system. Specify the resource tag name with primarytest, and it will print out to Unix stdout the string "primary" if the resource is on the primary hierarchy, or "secondary" if it is not.

The -o option can be used to retrieve the remote system associated with the resource tag specified.

The -g option takes one of three arguments, delete, restore, or remove. This option will run the preglobal scripts for the specified argument. The preglobal scripts are registered by applications to run before certain events. For example, with the restore argument, this option will run the prerestore script registered by LifeKeeper, then any prerestore scripts registered by all of the applications. Normally, the prerestore scripts will be performed automatically by perform_action [see LRACI-perform_action(1M)], except when the -G option is specified to perform_action. The -G option of perform_action allows multiple perform_action commands to be run, but have the preglobal scripts run only once before the first perform_action is run using lcdrecover -g restore. An application may register a preglobal script by installing the script at the path:


The arguments arg1, arg2, ... argn are arguments that will be passed to the preglobal scripts when they are executed.

Similar scripts (preremove) exist for the remove argument. They can be run before a perform_action -G -a remove ... is run. They are run when lcdrecover -g remove is executed.

The predelete scripts are similar, but they are run before the ins_remove -G ... [see LCDI-instance(1M)] program is run, unless -G for ins_remove is left out.

The -G option for lcdrecover is analogous to -g, except that it specifies that the postglobal scripts should be run. The -G option should not be used without running an earlier lcdrecover -g arg, and it should be run after all of the perform_action or ins_remove programs are run. If you are executing the -G option within a getlocks [see getlocks(1M)] protected region (after getlocks and before rlslocks), set arg1 to -m to avoid executing a second instance of getlocks, which would cause the operation to hang.

The following is an example of running multiple perform_action commands where the preglobal and postglobal scripts are run only once:

lcdrecover -g restore

# run "preglobal" restore scripts

perform_action -G -a restore -t tagname

# neither scripts are run

perform_action -G -a restore -t tagname2

# neither script is run

lcdrecover -G restore -- -m

# run "postglobal" restore scripts

# use -m arg when in getlocks protected region of code

# The following runs multiple prerestore and postrestore scripts:

perform_action -a restore -t tagname

# all scripts once

perform_action -a restore -t tagname2

# all scripts again

lcdrcp file1 file2 file3 ... {dest:ofile | dest:odir}

This is a general purpose program that is used to transfer the files file1 file2 file3 ... to another LifeKeeper system using the LifeKeeper communications path. The system the files will be copied to is dest, and the directory the files will be transferred to is odir. If only one file is sent, the alternate form including the destination file name at location ofile on system dest is provided.

lkstart [-w waitperiod]

This script will start up LifeKeeper on the current system, if it is currently not running. It will modify the entries in the /etc/inittab file pertaining to the LifeKeeper daemons so that they will be respawned. It will then inform the Unix init(1M) process to start the LifeKeeper daemons. The lkstart command does not return until all LifeKeeper daemon processes are running and all appropriate resources have been brought into service or until 900 seconds have elapsed. The -w option, with waitperiod in seconds, can be used to change this timeout interval. Use the -w argument to specify a wait period before the startup.

lkstop [-f|-n|-r]

The lkstop script will shutdown LifeKeeper on the local system if it is currently running. It will first remove all protected resources from service on the local system, then modify the entries in the /etc/inittab file pertaining to the LifeKeeper daemons, marking them as "off" (LifeKeeper will not automatically restart at system boot under these conditions, unless the -r option is used). It will then inform the Unix init(1M) process to terminate the LifeKeeper daemons.

The -f option will skip the section that removes resources from service. The resources will remain running on the local system, but will no longer be protected by LifeKeeper. This option should be used with caution, because if resources are not gracefully shutdown then items such as SCSI locks will not be removed. If the system on which lkstop -fis executed subsequently fails or is shutdown, the system(s) will NOT initiate failover of the appropriate resources. After reboot, resources that "remained running" will no longer be running on any system in the LifeKeeper cluster.

The -n option will remove the resources from service but does not set the !nofailover! flag [see LCDI-flag(1M)] on any of the systems that it can communicate with. Failover will occur when LifeKeeper stops. Neither the -r nor the -f option can be used with the -n option.

The -r option allows LifeKeeper to be manually stopped and then automatically restarted when the system reboots. The -r option will leave the resources running on the local system, but the resources will no longer be protected by LifeKeeper (as done by the -f option).


This script tests to see if LifeKeeper is currently running. It exits 0, if any of the main LifeKeeper processes are running; nonzero, if not. It produces ps -cf -like output lines for each LifeKeeper daemon process.


The following exit codes could be returned by these commands:


The operation has succeeded.


A Unix system call or library call has internally returned failure.


A user-specified syntax error occurred.


LifeKeeper internal error.


A request to perform an operation on an object that already exists.


An argument specified is illegal.


Index out-of-range.


A request has been made on an object that does not exist.


A request was made to delete a resource instance on which another non-deleted resource instance depends.


An attempt to communicate with another system failed.


The location of this utility, LKROOT, is defined in the default file /etc/default/LifeKeeper.



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