Solved

HELP NEEDED FAST!!!...ARCserve r11.1 Linux Agent

Posted on 2004-10-06
6
686 Views
Last Modified: 2007-10-18
I have recently upgraded my BrigthStor ARCserve to version r11.1 and also purchased 3 Linux agents.  They installed easy enough, but I have found when I restart a Linux box the agent doesn't start and therefore I can not connect to the Linux box from my ARCserve backup server.  I installed the Linux agent by copying a tar ball to the Linux box, untarring it and running 3 rpms.

The ARCserve backup server is a W2K Server SP4 domain controller machine.  Does anyone know what I need to do to ensure the Linux agent starts/works so I can still connect to the Linux box from the backup server after a Linux restart?  Please HELP!!!!
0
Comment
Question by:RedOakPackster
  • 2
  • 2
6 Comments
 

Author Comment

by:RedOakPackster
Comment Utility
The folks at CA say I need to do this, but it sounds like it's for starting the ARCserve backup software in Linux; not starting the Linux agent...

**********From CA is below****************************************
Copy the entire script below starting with the line ‘#!/bin/sh’ to the end of the document into a file on your Linux machine. You can call the file whatever you want. For this example, I will refer to the file as bab_autostart. It does not matter where you save the script file. Next you need to make this script file executable. At the prompt on the Linux machine, type:
chmod a+x bab_autostart
That will make the script executable. Then you just need to run the script. To do so, at the prompt type: ./bab_autostart

#!/bin/sh
#
# (c) Copyright 1994-2002 Computer Associates International, Inc.
# and/or its subsidiaries. All Rights Reserved. Use by the United
# States Government is subject to RESTRICTED RIGHTS as set out in
# the license agreement.
#
# Script to configure Automatic Startup and Shutdown BrightStor ARCserve Backup.
# Usage:-
# bab_autostrtstop [y|Y|n|N]

CAS_HOME=$BAB_HOME
CMD_CHKCONFIG=chkconfig
AUTO_START_RUNLEVEL=235
AUTO_STOP_RUNLEVEL=016
AUTO_START_RUNLEVEL_WITH_SPACE="2 3 5"
AUTO_STOP_RUNLEVEL_WITH_SPACE="0 1 6"
AUTO_START_REQUIRED_SERVICE="\$network \$portmap"
# Source Message File
#. $CAS_HOME/lib/nls/Messages
NLS_UTILITY_FILE=$CAS_HOME/bin/nls_utility
#
# Function load messages
#
LOAD_MESSAGES()
{
 
        if [ -x "$NLS_UTILITY_FILE" ]
        then
         MYLANG=`$NLS_UTILITY_FILE -g ${CAS_HOME}/lib/nls/nls.cfg CA_NLS_LANG 2>/dev/null`
         if [ "$MYLANG" = "" ]
         then
          MYLANG=C
         fi
                MESSAGES_PATH=`$NLS_UTILITY_FILE -m ${CAS_HOME}/lib/nls ${MYLANG}`
                if [ -f ${MESSAGES_PATH} ]
                then
                        .  ${MESSAGES_PATH}
                fi
        fi
}
ERRORMSG101="ERROR:   ${BOLD}Environment variable BAB_HOME is not set.${NORM}"
ERRORMSG101_1="         Please set it to the BrightStor ARCserve Backup installation directory"
BOLD=`tput bold 2>/dev/null`
NORM=`tput rmso 2>/dev/null`

TMPFILE="/tmp/bab_autostrtstop.$$"
TMPCTRLFILE="/tmp/bab_autoctrl.$$"
CTRLFILE="bab"
IDENTIFIER="bab"
LINUXINITDIRPARENT="etc/rc.d"
INITDIR="init.d"
PLATFORM=`uname -s`
case "${PLATFORM}" in
 Linux)
  ECHO="echo -e"
  if [ -d "/${LINUXINITDIRPARENT}/${INITDIR}" ]
  then
   LINUXCTRLFILE="/${LINUXINITDIRPARENT}/${INITDIR}/${CTRLFILE}"
  else
   LINUXCTRLFILE="/${LINUXINITDIRPARENT}/${CTRLFILE}"
  fi
  ;;
 *)
  ECHO="echo"
  ;;
esac
usage ()
{
 echo "Usage: "
 echo "bab_autostrtstop [y|Y|n|N]"
 exit 1
}
##################################################################
# gen_autofile
# Function to generate the file used for automatic shutdown and
# startup of BEB agents.
##################################################################
gen_autofile ()
{
   case "${PLATFORM}"  in
 Linux)
       ${ECHO}  "#!/bin/sh" > ${TMPCTRLFILE}
   LIBENV="LD_LIBRARY_PATH"
       ;;
    *)
         echo "Unsupported Platform."
   return 1
     ;;
   esac
${ECHO}  "# (c) Copyright 1994-2002 Computer Associates International, Inc.\n\
# and/or its subsidiaries. All Rights Reserved. Use by the United\n\
# States Government is subject to RESTRICTED RIGHTS as set out in\n\
# the license agreement.
#
# This script must be run with root access
#
" > ${TMPCTRLFILE}
   case "${PLATFORM}"  in
      Linux)
        check_chkconfig
        if [ $? -eq 0 ]
        then
        start_fileIndex=`get_HighestNum /${LINUXINITDIRPARENT}/rc2.d/ S`
        stop_fileIndex=`get_LowestNum /${LINUXINITDIRPARENT}/rc1.d/ K`
${ECHO}  "
# BELOW CONFIG IS FOR REDHAT
# chkconfig: $AUTO_START_RUNLEVEL  $start_fileIndex $stop_fileIndex
# description: startup or shutdown BrightStor along with OS.
# BELOW CONFIG IS FOR SUSE
### BEGIN INIT INFO
# Provides: bab
# Required-Start: $AUTO_START_REQUIRED_SERVICE
# Required-Stop:
# Default-Start: $AUTO_START_RUNLEVEL_WITH_SPACE
# Default-Stop: $AUTO_STOP_RUNLEVEL_WITH_SPACE
# Description: startup or shutdown BrightStor along with OS
### END INIT INFO
" >> ${TMPCTRLFILE}      
 fi
 
      ;;
    esac
${ECHO} "  
usage ()
{
 ${ECHO}  \"\$0 \"
 ${ECHO}  \"\"
}
[ -f /usr/bin/id -a -f /usr/bin/grep ] && {
IS_ROOT=\"\`/usr/bin/id | /usr/bin/grep root\`\"
if [ \"\$IS_ROOT\" = \"\" ]
then
   ${ECHO}  \"\$0: must be run with root access.\"
   exit 1
fi
}
rc=0
BAB_HOME=$CAS_HOME; export BAB_HOME
PATH=\$BAB_HOME/sbin:\$BAB_HOME/bin:/usr/bin:/bin:/sbin:/usr/sbin:\$PATH; export PATH" >> ${TMPCTRLFILE}
if [ "$CALIB" != "" ]
then
${ECHO}  "$LIBENV=$CALIB:/opt/CA/CAlib:\$BAB_HOME/lib:\$$LIBENV; export $LIBENV" >> ${TMPCTRLFILE}
else
${ECHO}   "$LIBENV=/opt/CA/CAlib:\$BAB_HOME/lib:\$$LIBENV; export $LIBENV" >> ${TMPCTRLFILE}
fi
${ECHO} "
case \"\$1\" in
    start)
 echo 100000000 > /proc/sys/kernel/shmmax
        if [ -f \${BAB_HOME}/sbin/cstart ]
        then
            \${BAB_HOME}/sbin/cstart
            rc=\$?
              if [ -f /usr/bin/uagent ]
              then
               /usr/bin/uagent start
    if [ \$rc -eq 0 -a -d /var/lock/subsys ]
    then  
   touch /var/lock/subsys/$CTRLFILE
                  fi
       fi              
        fi
       
        ;;
    stop)
        if [ -f \${BAB_HOME}/sbin/cstop ]
        then
            \${BAB_HOME}/sbin/cstop -f
            \${BAB_HOME}/sbin/stopingres
            rc=\$?
       if [ -f /usr/bin/uagent ]
       then
           /usr/bin/uagent stop
           if [ \$rc -eq 0 -a -f /var/lock/subsys/$CTRLFILE ]
           then  
    rm -f /var/lock/subsys/$CTRLFILE 2>/dev/null
       fi
       fi            
        fi
        ;;
    start_msg)
        ${ECHO}  \"Start BrightStor ARCserve Backup.\"
        rc=0
        ;;
    stop_msg)
        ${ECHO}  \"Stop BrightStor ARCserve Backup.\"
        rc=0
        ;;
    *)
        usage
        rc=1
        ;;
esac
exit \$rc" >> ${TMPCTRLFILE}
}

cfg_auto ()
{
 rc=0
   #Remove earlier config if any
   uncfg_auto
   rc=$?
 if [ "$rc" -ne 0 ]
 then
  return $rc
   fi
   gen_autofile
   rc=$?
 if [ "$rc" -ne 0 ]
 then
  return $rc
   fi
   case "${PLATFORM}"  in
      Linux)
        check_chkconfig
        if [ $? -eq 0 ]
        then
   cfg_Linux_by_cmd
   rc=$?
   if [ $rc -ne 0 ]
   then
    uncfg_Linux_by_cmd
    cfg_Linux
    rc=$?  
   fi
  else
   cfg_Linux
   rc=$?
  fi  
  if [ -d /var/lock/subsys ]
  then
   touch /var/lock/subsys/${CTRLFILE}
  fi
   
   
       ;;      
    *)
         echo "Unsupported Platform."
   rc=1
     ;;
   esac
 return $rc
}
cfg_Linux ()
{
   case "${PLATFORM}"  in
 Linux)  
  TVAR1="${LINUXCTRLFILE}"
  TVAR2="${LINUXINITDIRPARENT}"
  ;;
    *)
         echo "Unsupported Platform."
         
   return 1
     ;;
   esac
   cp ${TMPCTRLFILE} ${TVAR1}
 rc=$?
 if [ $rc -ne 0 ]
 then
        echo "Command failed [errorNo= $rc]"
    return 1
 fi
 chmod 555 ${TVAR1}
 rc=$?
 if [ $rc -ne 0 ]
 then
        echo "Command failed [errorNo= $rc]"
    return 1
 fi
 if [ "${PLATFORM}" != "Linux" ]
 then
  [ -d /${TVAR2}/rcS.d/ ] && \
  {
     fileIndex=`get_HighestNum /${TVAR2}/rcS.d/ K`
     rm -f /${TVAR2}/rcS.d/K${fileIndex}${CTRLFILE} 2>/dev/null
     ln -s ${TVAR1} /${TVAR2}/rcS.d/K${fileIndex}${CTRLFILE}
     rc=$?
     if [ $rc -ne 0 ]
     then
          echo "Command failed [errorNo= $rc]"
        return 1
     fi
     }
    fi
   case "${PLATFORM}"  in
       Linux)
       [ -d /${TVAR2}/rc0.d/ ] && \
       {
          fileIndex=`get_LowestNum /${TVAR2}/rc0.d/ K`
          rm -f /${TVAR2}/rc0.d/K${fileIndex}${CTRLFILE}  2>/dev/null
          ln -s ${TVAR1} /${TVAR2}/rc0.d/K${fileIndex}${CTRLFILE}
          rc=$?
          if [ $rc -ne 0 ]
          then
               echo "Command failed [errorNo= $rc]"
             return 1
          fi      
         }
   ;;
   esac
   case "${PLATFORM}"  in
 Linux)
       [ -d /${TVAR2}/rc1.d/ ] && \
       {
          fileIndex=`get_LowestNum /${TVAR2}/rc1.d/ K`
         rm -f /${TVAR2}/rc1.d/K${fileIndex}${CTRLFILE}   2>/dev/null
          ln -s ${TVAR1} /${TVAR2}/rc1.d/K${fileIndex}${CTRLFILE}
          rc=$?
          if [ $rc -ne 0 ]
          then
               echo "Command failed [errorNo= $rc]"
             return 1
          fi
         }  
           ;;
      *)
       [ -d /${TVAR2}/rc1.d/ ] && \
       {
          fileIndex=`get_HighestNum /${TVAR2}/rc1.d/ K`
         rm -f /${TVAR2}/rc1.d/K${fileIndex}${CTRLFILE}   2>/dev/null
          ln -s ${TVAR1} /${TVAR2}/rc1.d/K${fileIndex}${CTRLFILE}
          rc=$?
          if [ $rc -ne 0 ]
          then
               echo "Command failed [errorNo= $rc]"
             return 1
          fi
         }
   ;;
   esac
 [ -d /${TVAR2}/rc2.d/ ] && \
 {
    fileIndex=`get_HighestNum /${TVAR2}/rc2.d/ S`
    rm -f /${TVAR2}/rc2.d/S${fileIndex}${CTRLFILE}  2>/dev/null
    ln -s ${TVAR1} /${TVAR2}/rc2.d/S${fileIndex}${CTRLFILE}
    rc=$?
    if [ $rc -ne 0 ]
    then
         echo "Command failed [errorNo= $rc]"
     return 1
      fi
   }
   case "${PLATFORM}"  in
      Linux)
       [ -d /${TVAR2}/rc3.d/ ] && \
       {
          fileIndex=`get_HighestNum /${TVAR2}/rc3.d/ S`
          rm -f /${TVAR2}/rc3.d/S${fileIndex}${CTRLFILE}  2>/dev/null
          ln -s ${TVAR1} /${TVAR2}/rc3.d/S${fileIndex}${CTRLFILE}
          rc=$?
          if [ $rc -ne 0 ]
          then
               echo "Command failed [errorNo= $rc]"
           return 1
            fi
         }      
       ;;
   esac
   
   case "${PLATFORM}"  in
      Linux)
       [ -d /${TVAR2}/rc5.d/ ] && \
       {
          fileIndex=`get_HighestNum /${TVAR2}/rc5.d/ S`
          rm -f /${TVAR2}/rc5.d/S${fileIndex}${CTRLFILE}  2>/dev/null
          ln -s ${TVAR1} /${TVAR2}/rc5.d/S${fileIndex}${CTRLFILE}
          rc=$?
          if [ $rc -ne 0 ]
          then
               echo "Command failed [errorNo= $rc]"
           return 1
            fi
         }
         
       [ -d /${TVAR2}/rc6.d/ ] && \
       {
          fileIndex=`get_LowestNum /${TVAR2}/rc6.d/ K`
          rm -f /${TVAR2}/rc6.d/K${fileIndex}${CTRLFILE}  2>/dev/null
          ln -s ${TVAR1} /${TVAR2}/rc6.d/K${fileIndex}${CTRLFILE}
          rc=$?
          if [ $rc -ne 0 ]
          then
               echo "Command failed [errorNo= $rc]"
           return 1
            fi
         }      
                       
       ;;
   esac
     
 return 0
}
check_chkconfig()
{
 if [ -f `which $CMD_CHKCONFIG 2>/dev/null ` ]
 then
  return 0
 else
  return 1
 fi
}
cfg_Linux_by_cmd()
{
 rm -f ${LINUXCTRLFILE} 2>/dev/null
 cp ${TMPCTRLFILE} ${LINUXCTRLFILE}
 chmod a+x ${LINUXCTRLFILE}
 ${CMD_CHKCONFIG} --level $AUTO_START_RUNLEVEL $CTRLFILE on  >/dev/null 2>&1
 ${CMD_CHKCONFIG} --level $AUTO_STOP_RUNLEVEL $CTRLFILE off  >/dev/null 2>&1
 rc=$?
# if [ $rc -ne 0 ]
# then
#  ${CMD_CHKCONFIG} -a $CTRLFILE >/dev/null 2>&1
#  rc=$?
# fi
 return $rc
}
get_LowestNum()
{
   num=0
   case "${PLATFORM}"  in
      Linux)
         #By Convention files are [S,K][0-9][0-9]filename
          num=`printf "%.2d" $num`
         ;;
      *)
         echo "Unknown error."
         rc=1
         ;;                                                                                              
   esac
 ${ECHO}  $num
 
}
get_HighestNum ()
{
 DIR=$1
 PATTERN=$2
 case ${PATTERN} in
  K)
       num=`ls ${DIR}K[0-9]* 2>/dev/null |sed -ne 's/.*\/K\([0-9]*\).*$/\1/p'|sort -n|tail -1`
   ;;
  S)
       num=`ls ${DIR}S[0-9]* 2>/dev/null |sed -ne 's/.*\/S\([0-9]*\).*$/\1/p'|sort -n|tail -1`
   ;;
   esac
 
   if [ -z "$num" ] ;then
    num=0
   fi
   case "${PLATFORM}"  in
      Linux)
         #By Convention files are [S,K][0-9][0-9]filename
         if [ $num -ge 99 ]
         then
            num=99
         else
            num=`expr $num + 1`
            num=`printf "%.2d" $num`
         fi
         ;;
      *)
         echo "Unknown error."
         rc=1
         ;;                                                                                              
   esac
 ${ECHO}  $num
}
uncfg_auto ()
{
 rc=0
   case "${PLATFORM}"  in
      Linux)
        check_chkconfig
        if [ "$?" -eq 0 ]
        then
   uncfg_Linux_by_cmd
   uncfg_Linux
   rc=$?  
   
  else
   uncfg_Linux
   rc=$?
  fi    
  if [ -f /var/lock/subsys/${CTRLFILE} ]
  then
   rm -f  /var/lock/subsys/${CTRLFILE} 2>/dev/null
  fi
       ;;            
    *)
         echo "Unsupported Platform."
         rc=1
     ;;
   esac
   
 return $rc
}
uncfg_Linux ()
{
   case "${PLATFORM}"  in
 Linux)  
  TVAR1="${LINUXCTRLFILE}"
  TVAR2="${LINUXINITDIRPARENT}"
  ;;      
    *)
         echo "Unsupported Platform."
   return 1
     ;;
   esac
   [ -f ${TVAR1} ] && \
 {
    rm ${TVAR1}
  rc=$?
    if [ $rc -ne 0 ]
    then
         echo "Command failed [errorNo= $rc]"
     return 1
  fi
   }
 [ -h /${TVAR2}/rcS.d/K[0-9]*${CTRLFILE} ] && \
 {
    rm /${TVAR2}/rcS.d/K[0-9]*${CTRLFILE}
    rc=$?
    if [ $rc -ne 0 ]
    then
         echo "Command failed [errorNo= $rc]"
       return 1
    fi
   }
   
 [ -h /${TVAR2}/rc0.d/K[0-9]*${CTRLFILE} ] && \
 {
    rm /${TVAR2}/rc0.d/K[0-9]*${CTRLFILE}
    rc=$?
    if [ $rc -ne 0 ]
    then
         echo "Command failed [errorNo= $rc]"
     return 1
  fi
   }
   
 [ -h /${TVAR2}/rc1.d/K[0-9]*${CTRLFILE} ] && \
 {
    rm /${TVAR2}/rc1.d/K[0-9]*${CTRLFILE}
    rc=$?
    if [ $rc -ne 0 ]
    then
         echo "Command failed [errorNo= $rc]"
     return 1
  fi
   }
 [ -h /${TVAR2}/rc2.d/S[0-9]*${CTRLFILE}  ] && \
 {
    rm /${TVAR2}/rc2.d/S[0-9]*${CTRLFILE}
    rc=$?
    if [ $rc -ne 0 ]
    then
         echo "Command failed [errorNo= $rc]"
       return 1
    fi
   }
   case "${PLATFORM}"  in
      Linux)
 [ -h /${TVAR2}/rc3.d/S[0-9]*${CTRLFILE}  ] && \
 {
    rm /${TVAR2}/rc3.d/S[0-9]*${CTRLFILE}
    rc=$?
    if [ $rc -ne 0 ]
    then
         echo "Command failed [errorNo= $rc]"
       return 1
    fi
   }
       ;;
   esac
   case "${PLATFORM}"  in
      Linux)
 [ -h /${TVAR2}/rc5.d/S[0-9]*${CTRLFILE}  ] && \
 {
    rm /${TVAR2}/rc5.d/S[0-9]*${CTRLFILE}
    rc=$?
    if [ $rc -ne 0 ]
    then
         echo "Command failed [errorNo= $rc]"
       return 1
    fi
   }
 [ -h /${TVAR2}/rc6.d/K[0-9]*${CTRLFILE}  ] && \
 {
    rm /${TVAR2}/rc6.d/K[0-9]*${CTRLFILE}
    rc=$?
    if [ $rc -ne 0 ]
    then
         echo "Command failed [errorNo= $rc]"
       return 1
    fi
   }
     
       ;;
   esac
   
 return 0
}
uncfg_Linux_by_cmd()
{
 ${CMD_CHKCONFIG} --del $CTRLFILE >/dev/null 2>&1
 rc=$?
# if [ $rc -ne 0 ]
# then
#  ${CMD_CHKCONFIG} -d  $CTRLFILE >/dev/null 2>&1
#  rc=$?
# fi
 return $rc
}
###################################################
# Main
###################################################
if [ "${LANG}" = "" ]
then
 LANG=C
fi
LOAD_MESSAGES
if [ "$CAS_HOME" = "" ]
then
  ${ECHO}  "${ERRORMSG101}"
  ${ECHO}  "${ERRORMSG101_1}"
  ${ECHO}
  exit 1
fi
# This script must be run with root access
#
IS_ROOT="`id | grep root`"
if [ "$IS_ROOT" = "" ]
then
   ${ECHO}  "${ERRORMSG53} $0 ${ERRORMSG54}"
 exit 1
fi
reply=""
if [ $# -eq 0 ]
then
  while [ 1 -eq 1 ]
  do
 # Default interactive configuration
        ${ECHO}
 echo "You can configure BrightStor ARCserve Backup for automatic startup and shutdown as part of your operating system startup and shutdown."
 echo -e "Do you want to enable automatic startup and shutdown of BrightStor ARCserve Backup (y/n [y]): \c"
 read reply
        case $reply in
          ""|y|Y|n|N)
            break
            ;;
          *)
            echo "Invalid Input!"
            ;;
        esac
  done
else
 reply="$1"
fi
rCode=0
case $reply in
  "")
  cfg_auto
  rCode=$?
  ;;
  y|Y)
  cfg_auto
  rCode=$?
  ;;
  n|N)
  uncfg_auto
  rCode=$?
  ;;
    *)
    usage
  ;;
esac
# Delete the temporary file
[ -f "${TMPCTRLFILE}" ] && rm -f "${TMPCTRLFILE}"
[ -f "${TMPFILE}" ] && rm -f "${TMPFILE}"
exit $rCode
0
 
LVL 3

Expert Comment

by:Ultimate_NescaFe
Comment Utility
LOL, quite a long code :)
0
 

Author Comment

by:RedOakPackster
Comment Utility
Yea, I know.  Please don't anyone review it for accuracy, just verify that that is what I'm supposed to do to make sure the Linux AGENT starts at boot up and not ARCserve FOR LINUX.  They are two different things.
0
 
LVL 3

Accepted Solution

by:
Ultimate_NescaFe earned 500 total points
Comment Utility
Yes, I have looked at it and it seems that this code should di the job. Why dont you try it and give some feedback, you can always reverse it later
0
 
LVL 2

Expert Comment

by:aswigon
Comment Utility
I would suggest just adding the line "uagent start" (without the quotes) to the rc.local file. That will just start the client agent service at boot up.
0

Featured Post

Scale it in WD Gold

With up to ten times the workload capacity of desktop drives, WD Gold hard drives employ advanced technology to deliver among the best in reliability, capacity, power efficiency and performance.

Join & Write a Comment

Sometimes the best way to deal with an infected computer is to boot from external media and run your tools from there.  The reason you may wish to do this really depends on the infection.  Some malware is so recalcitrant that no matter what you do i…
We wanted to provide an in-depth explanation of the Ping Node offering clarifications on its function and usage. Incorrect Ping Node configuration and functionality can cause problems with HA clusters. The importance of this article is critical for …
This video teaches viewers how to encrypt an external drive that requires a password to read and edit the drive. All tasks are done in Disk Utility. Plug in the external drive you wish to encrypt: Make sure all previous data on the drive has been …
This Micro Tutorial will teach you how to reformat your flash drive. Sometimes your flash drive may have issues carrying files so this will completely restore it to manufacturing settings. Make sure to backup all files before reformatting. This w…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now