#! /bin/sh # $Revision: 1.16 $ #bcpyrght #*************************************************************************** #* $VRTScprght: Copyright 1993 - 2004 VERITAS Software Corporation, All Rights Reserved $ * #*************************************************************************** #ecpyrght # ## Start NetBackup Exec as a standalone Java application. # PATH=.:/bin:/usr/bin:/usr/ucb:$PATH; export PATH INSTALL_DIR=/usr/openv/java INSTALL_PATH=$INSTALL_DIR DOTNBJ_CONF=$INSTALL_PATH/.nbjConf NBJ_CONF=$INSTALL_PATH/nbj.conf OS=`uname -s` if [ "$OS" = "Linux" ] then unset POSIXLY_CORRECT ECHO="/bin/echo -e" else ECHO="/usr/bin/echo" fi ## Read the configuration variables. . $DOTNBJ_CONF if [ "$JNB_LOG" = "" ] then LOG_FILE=$INSTALL_PATH/logs/`whoami`.jnbSA.$$.log else LOG_FILE=$JNB_LOG fi DEBUG_PROPERTIES=$INSTALL_PATH/Debug.properties ## Set default values for INITIAL_MEMORY and MAX_MEMORY. INITIAL_MEMORY=36M MAX_MEMORY=256M ## Get the values for INITIAL_MEMORY and MAX_MEMORY from conf file. ## Assume the last uncommented one of each in the file is the one to use. line=`cat $NBJ_CONF | egrep -v "^#" | egrep -i "INITIAL_MEMORY" | tail -1` if [ "$line" != "" ] ; then INITIAL_MEMORY=`echo $line | cut -d= -f2 | awk '{print $1}'` fi line=`cat $NBJ_CONF | egrep -v "^#" | egrep -i "MAX_MEMORY" | tail -1` if [ "$line" != "" ] ; then MAX_MEMORY=`echo $line | cut -d= -f2 | awk '{print $1}'` fi export INITIAL_MEMORY export MAX_MEMORY LOG_CMDLINES=false while [ "`$ECHO $1 | cut -c1`" = "-" ] do case "$1" in -d | -display) DISPLAY=$2;export DISPLAY; shift 2;; -D) DEBUG_PROPERTIES=$2;export DEBUG_PROPERTIES; shift 2;; -h) $ECHO "\nUsage: $0 [option]\n" $ECHO " option:" $ECHO " -d Hostname to display to, e.g., 'eagle:0.0'." $ECHO " -D Debug properties file." $ECHO " -h Help." $ECHO " -l Full path of log file." $ECHO " -lc Log cmdlines used by the application to the log file." $ECHO " -ms Initial Java VM memory." $ECHO " -mx Maximum Java VM memory." exit 2;; -l) LOG_FILE=$2;export LOG_FILE; shift 2;; -lc) LOG_CMDLINES=true;export LOG_CMDLINES; shift 1;; -ms) INITIAL_MEMORY=$2;export INITIAL_MEMORY; shift 2;; -mx) MAX_MEMORY=$2;export MAX_MEMORY; shift 2;; *) $ECHO "\nUsage: $0 [option]\n" $ECHO " option:" $ECHO " -d Hostname to display to, e.g., 'eagle:0.0'." $ECHO " -D Debug properties file." $ECHO " -h Help." $ECHO " -l Full path of log file." $ECHO " -lc Log cmdlines used by the application to the log file." $ECHO " -ms Initial Java VM memory." $ECHO " -mx Maximum Java VM memory." exit 2;; esac done CLASSPATH=$PJAR:.:$INSTALL_PATH:$COMMONJAR:$DBEXTJAR:$JBPJAR:$CHART_JAR:$FSAJAR:$HSMJAR:$NBJAR:$PV_JAR:$KL_JAR:$JDOM_JAR:$HELPVIEWER_JAR:$SCHED_JAR; export CLASSPATH # The following is needed to prevent Java from exceeding the default open # file limit because it does not close image files fast enough. ulimit -n 1024 case "$OS" in OSF1) LD_LIBRARY_PATH=$VRTS_LIBRARY_PATH:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH;; AIX) LIBPATH=$VRTS_LIBRARY_PATH:$LIBPATH; export LIBPATH;; HP-UX) SHLIB_PATH=$VRTS_LIBRARY_PATH:$SHLIB_PATH; export SHLIB_PATH;; Linux) LD_LIBRARY_PATH=$VRTS_LIBRARY_PATH:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH;; SunOS) # On Solaris, due to a bug fix made by Sun for release levels after 5.6, if the locale # is currently C/POSIX it needs to be set to ISO 8859-1 in order to display extended # characters RELEASE_LVL=`uname -r` if [ $RELEASE_LVL -ge 5.7 ] then if [ "$LC_ALL" = "" ] then eval LC_ALL="$LANG" >> /dev/null 2>&1 export LC_ALL fi if [ "$LC_ALL" = "C" ] || [ "$LC_ALL" = "" ] then eval LC_ALL=iso_8859_1 >> /dev/null 2>&1 export LC_ALL eval LANG=iso_8859_1 >> /dev/null 2>&1 export LANG fi fi # On Solaris, LD_LIBRARY_PATH must be set for access to libX11 - default it to # /usr/openwin/lib. If it doesn't exist, inform the user and quit. if [ -d /usr/openwin/lib ] then LD_LIBRARY_PATH=/usr/openwin/lib:$VRTS_LIBRARY_PATH:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; else $ECHO "\n\tDirectory /usr/openwin/lib doesn't exist. It is the default" $ECHO "\tlocation for libX11.so.4 which is required by NB-Java." $ECHO "\tPlease create the /usr/openwin/lib directory and a symbolic" $ECHO "\tlink to libX11.so.4 or modify this script to properly set the" $ECHO "\tLD_LIBRARY_PATH environment variable.\n" exit 1 fi;; esac XENVIRONMENT=$INSTALL_PATH/Xenv;export XENVIRONMENT if [ "$LOG_FILE" != "" ] then $ECHO "\nYour DISPLAY environment variable is set as follows:" > $LOG_FILE $ECHO "$DISPLAY\n" >> $LOG_FILE $ECHO "\n\tThe log file for this execution instance is\n\t$LOG_FILE\n" fi # The ordering of parameters here is important. In particular, the # -Dvrts.NBJAVA_CONF parameter must be first. bpps and bp.kill_all are # using this to distinguish NB java processes from NBAR and VSM java processes. $JAVA_PATH -Dvrts.NBJAVA_CONF=$NBJ_CONF -showversion -Dvrts.common.server.LOG_CMDLINES=${LOG_CMDLINES} -Djava.library.path=${VRTS_LIBRARY_PATH} -Dvrts.common.utilities.DEBUG_PROPERTIES=$DEBUG_PROPERTIES -Xms$INITIAL_MEMORY -Xmx$MAX_MEMORY vrts.nbe.AdminConsole >> $LOG_FILE 2>&1 if [ $? != "0" ] && [ -s $LOG_FILE ] then cat $LOG_FILE fi ## The end ...