1 Reply Latest reply on Oct 5, 2009 11:59 AM by Bill Robinson

    Solaris 10 RSCD startup script for Global hosts and Virtual hosts

      Is there an RSCD startup script (/etc/init.d/rscd) for Solaris 10 that can distinguish whether the RSCD daemon is running on the Global host or within the Virtual host?   By design, the Virtual hosts inherit the /etc directory from the Global host.  So when the RSCD agent is stopped on the Global host, it also stops it on all of the Virtual hosts running on that server.

       

      The old Bladelogic forums contained a post with the correct stratup script but I can't seem to locate it on the new forums.  These are Solaris 10 servers running RSCD agents version 7.4.2.  Any help would be appreciated.

       

      Thanks,

      -- Andrew

        • 1. Re: Solaris 10 RSCD startup script for Global hosts and Virtual hosts
          Bill Robinson

          This should be added in later releases of the product, this script is from 7.6.

           

          #!/bin/sh
          #
          NSHDIR=/usr/nsh
          LD_LIBRARY_PATH=${LD_LIBRARY_PATH:=}${LD_LIBRARY_PATH:+:}/usr/nsh/lib
          export LD_LIBRARY_PATH

          #
          # Start the RSCD Daemon
          #

          RSCDHOME=/usr/nsh
          export RSCDHOME

          case $1 in
          stop)
              GLOBAL=0

              # checking if we have zonename command available
              # If it is available, then we can assume that this version of Solaris
              # supports zones.
              name=`sh -c "zonename" 2>/dev/null`
              if test $? -eq 0
              then
                   #zonename command exists on the server
                   if test "$name" = "global"
                   then
                       GLOBAL=1
                   fi
              fi


              if [ 1 -eq $GLOBAL ]
              then
                  #get pids only for global zone
                  PIDS=`ps -efZ | sed -n "/^[\t\ ]*global/ p" | grep bin/rsc[dw] | grep -v grep | awk ' { print $3 }'`
              else
                  PIDS=`ps -ef | grep bin/rsc[dw] | grep -v grep | awk ' { print $2 }'`
              fi
              if test -n "$PIDS"
              then
                  kill -9 `echo $PIDS`

                  # Sometimes the watcher process gives us trouble.
                  # Try killing a second time just to be sure.
                  if [ 1 -eq $GLOBAL ]
                  then
                      #get pids only for global zone
                      PIDS=`ps -efZ | sed -n "/^[\t\ ]*global/ p"| grep bin/rsc[dw] | grep -v grep | awk ' { print $3 }'`
                  else
                      PIDS=`ps -ef | grep bin/rsc[dw] | grep -v grep | awk ' { print $2 }'`
                  fi
                  if test -n "$PIDS"
                  then
                      kill -9 `echo $PIDS`
                  fi
              fi
              ;;

          start)
              if test -f $RSCDHOME/bin/rscd
              then
                  echo "Starting RSCD Daemon ..."
                  (cd $RSCDHOME; bin/rscd < /dev/null > /dev/null 2>&1) >/dev/null 2>&1
              fi
              ;;
          esac