You are here: Administration > Man Pages > prfuncs(5)

prfuncs(5)

NAME

prfuncs(5) — printing functions used by LRACI-perform_action

SYNOPSIS

LKROOT/subsys/actions/prfuncs

log arg1 arg2 arg3 ...

pl arg1 arg2 arg3 ...

pt arg1 arg2 arg3 ...

DESCRIPTION

These print functions are the preferred way in which LRACI-perform_action scripts should print to the LifeKeeper log file, the TTY, or system console.  If these printing functions are used, a LifeKeeper recovery kit can maintain compatibility when log files or print output needs to change. Note that these functions are Linux shell functions which can be included in a Linux shell script using the following command:

. /opt/LifeKeeper/subsys/actions/prfuncs

SYNTAX

log arg1 arg2 arg3 ...

The arguments arg1, arg2, arg3 ... are written to the LifeKeeper log.

pl arg1 arg2 arg3 ...

In addition to doing what log does, the arguments arg1, arg2, arg3 ..., are also printed to the controlling terminal of the process, if the Unix stdout for that process is directed to a terminal and not directed to a file (as it would be if run nohup and in the background). The idea behind this function is to send the arguments to both the LifeKeeper log and to the controlling terminal so that they are both seen on the terminal and saved to the log. If the script calling this function is run nohup and in the background, there is an assumption that Linux stdout and stderr of the script is directed to the LifeKeeper log, and there is no need to explicitly call the log function inside of the pl function. If the script calling this function is run with Linux stdout directed to a terminal, the explicit call to the log function is necessary because information will be lost when it scrolls off of a terminal screen.

pt arg1 arg2 arg3 ...

In addition to doing what pl does, the arguments arg1, arg2, arg3, ... are also printed to the system console /dev/console, if the process that is calling the pt function has Linux stdout directed to (the controlling terminal) something other than /dev/console.

EXAMPLE

The following example illustrates how to use these functions:

# define the path to the LifeKeeper product

LKROOT=/opt/LifeKeeper

# dot in the printing functions

. $LKROOT/subsys/actions/pfruncs

log "lifekeeper: RESTORE DEVICE $ID START AT: `date`"

err=1

trapfunc() { ... }

rm -f /tmp/??$$

log "LifeKeeper: RESTORE DEVICE $ID END err=$err AT: `date`"

exit $err

]

trap "trapfunc" 0 1 2 3 4 6 7 8 10 12 13 15 19

disk=`echo "$ID" | cut -c1-5`

if [ "$disk" = disk ]

then

UNAME=`uname` 

DKTABDIR-/etc/lk 

LK=$LKROOT/lkadm 

pt "LifeKeeper: locking disk $ID" 

pl "t scsisdev -1 /dev/dsk/$ID" 

fi

err=0

exit $err

EXIT CODES

Exit codes are undefined for these functions.

NOTES

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

The prfuncs utilities are often used when creating scripts used with LifeKeeper's Generic Application Recovery Kit facility.  

FILES

/etc/default/LifeKeeper

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