Chapter 7 HPSS User Interface Configuration446 September 2002 HPSS Installation GuideRelease 4.5, Revision 2Here is a sample user_cmd.tcl:#!/bin/kshset pre_start_dfs "/var/hpss/hdm/hdm1/pre_start_dfs"set pre_start_dfs_fail_on_error $TRUEset pre_stop_dfs "/var/hpss/hdm/hdm1/pre_stop_dfs"set post_stop_dfs "/var/hpss/hdm/hdm1/post_stop_dfs"The pre_start_dfs Korn shell script will break before trying to start DFS and export DFS files. Thescript ensures that the HDMs are all running. If there is any problem doing that DFS will not bestarted, giving the system administrator a chance to fix the problem.If this script needs to be modified, it is important to make sure that incidental messages that wouldnormally be written to stderr get rerouted to stdout or /dev/null. Otherwise the TCL proceduresthat call pre_start_dfs will assume the script has had an error, even if the script eventually calls exit0. It is also important to redirect all output from the hpss_hdm command; otherwise TCL will waitfor the HDM to stop before going ahead with the startup, with the result that DFS will never start.In this script, be sure to set the delay parameter on cfgdmepi to 1. This parameter controls themaximum delay time between client retries after an operation fails. In general, a delay parameterof N causes a maximum delay interval of 4 raised to the Nth power. If N is zero, retries will be doneonce a second which may cause the system to thrash. If N is omitted, the default value of 5 will beused, which can result in delay times as long 1024 seconds (roughly 17 minutes).7.6.3.2.1 DFS Configuration ScriptsThe pre_start_dfs script is executed before DFS is started.An example of the pre_start_dfs for AIX is as follows:#!/bin/kshexport HPSS_PATH_BIN=/opt/hpss/binecho " loading dfscore, dfssvr, and dcelfs"/usr/sbin/cfgdfs -a /usr/lib/drivers/dfscore.ext/usr/sbin/cfgdfs -a /usr/lib/drivers/dfssvr.ext/usr/sbin/cfgdfs -a /usr/lib/drivers/dcelfs.extecho " configuring dmepi"/usr/sbin/cfgdmepi -delay 1 -a /usr/lib/drivers/dmlfs.extif [ $? != 0 ]; thenexit 1fi# Start the servers (two of them in this example):for id in 0 1; dokey=`expr 3788 + $id`var=/var/hpss/hdm/hdm$id$HPSS_PATH_BIN/hdm_admin -k $key -s $id -v $var ps >/dev/null 2>&1if [ $? != 0 ]; thenecho " starting hdm$id"rm -f $var/hdm.out$HPSS_PATH_BIN/hpss_hdm $var/config.dat $id > $var/hdm.out 2>&1status=$?if [ $status != 0 ]; then