5.5 drd sync system shutdown script
To run the following script during system shutdown, create the script in the /sbin/init.d directory and create a symlink to it from /sbin/rc[n].d/K[mmm]. The system administrator can choose values for n and mmm to ensure that file updates made during shutdown occur before the script is run. The script must be run before file systems are unmounted, which is generally done by /sbin/ rc0.d/K900localmount. See rc(1) for further information on rc script numbering.
#!/sbin/sh
#
#synchronize source root group with cloned root group
#
#
PATH=/sbin:/usr/sbin:/usr/bin:/opt/drd/bin export PATH
rval=0
DRD_MOUNT_PT=/var/opt/drd/mnts/sysimage_001
set_return() {
if [ $1
rval=1
fi
}
case $1 in stop_msg)
echo "Running drd sync to synchronize cloned root file systems"
;;
stop)
# Synchronize the source disk with the cloned system
drd mount >/dev/null 2>&1 # Ignore errors, may already be mounted. drd sync
sync_ret=$?
set_return $sync_ret "ERROR: Return code from drd sync is $sync_ret" rm
[[
set_return 1 "ERROR: The $0 script (on image being shut down) could not be removed." [[
set_return 1 "ERROR: The ${DRD_MOUNT_PT}$0 script ($0 on clone) could not be removed." drd umount >/dev/null 2>&1 # Ignore errors.
;;
*)
echo "usage: $0 { stop_msg stop }" rval=1
;;
esac
exit $rval
5.5 drd sync system shutdown script | 31 |