Issues with setsite command

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Issues with setsite command

  • Creator
    Topic
  • #54050
    Kevin Crist
    Participant

      I am currently testing the CL6.0.1 upgrade (fromCL 5.4.1) and some scripts that we use are having issues with the setsite command. Code below. In 5.4.1 we pretty much run this script any where and it executes but in our 6.0.1 we get

      /usr/local/bin/statusall_test: line 24: setsite: command not found

      HCI root is /pwim/cis6.0/integrator

      HCI master site is gsh_global

      No HCI site

      Environment var ‘HCISITEDIR’ missing

      Environment var ‘HCISITEDIR’ missing

      No site is set.

      And this happens for all of them with the setsite. i have tried replacing the setsite witht the actual path /pwim/cis6.0/integrator/kshlib/setsite but no luck. If we do a manual setsite into a site and run the script then it run, but only for that one site but thats not what we want. Anyone point me in the right direction with any ideas? We are going from Unix to LinuxRedHat.

      Thanks.

      ####################################################

      # SCRIPT: /usr/local/bin/statusall_test            #

      # PURPOSE:  Shows status of connections, processes #

      #           and lock mgr/monitor daemon for all    #

      #           production sites.                      #

      ####################################################

      clear

      echo

      echo “Checking Status for site:”

      echo

      setsite test050

      showroot

      echo

      hciconnstatus

      hciprocstatus

      hcisitectl

      sleep 3

      clear

      echo

      echo “Checking Status for site:”

      echo

      setsite test100

      showroot

      echo

      hciconnstatus

      hciprocstatus

      hcisitectl

      sleep 5

      clear

      echo

      echo “Checking Status for site:”

      echo

      setsite test200

      showroot

      echo

      hciconnstatus

      hciprocstatus

      hcisitectl

      sleep 5

      clear

      echo

      echo “Checking Status for site:”

      echo

      setsite test250

      showroot

      echo

      hciconnstatus

      hciprocstatus

      hcisitectl

      sleep 5

      Code:

    Viewing 4 reply threads
    • Author
      Replies
      • #79984
        Terry Kellum
        Participant

          Wild guess:

          Try:

          source /home/hci/.profile

          At the start of your script.

        • #79985
          Kevin Crist
          Participant

            Thanks for the reply Terry. Unfortunately i got the same error.

          • #79986
            Russ Ross
            Participant

              A long time ago I learned setsite was not as clean as I would like and discover some left over baggae when using it.

              I’m not sure if that is true anymore but I went to using setroot from KSH scripts to change sites and avoid using setsite.

              Here is an example KSH script I located to illustrate how I use setroot that has worked better for me than setsite probably becuase the “setroot clear” gets me to a clean slate first before doing the second setroot that sets the HCIROOT and HCISITE.

              Code:

              #!/usr/bin/ksh

              # Begin Module Header ==========================================================
              #
              #
              #——
              # Name:
              #——
              #
              # mk_stop_start_scripts_for_all_sites.ksh
              #
              #———
              # Purpose:
              #———
              #
              # dynamically create all the
              #
              #    $HCISITEDIR/scripts/site_shutdown.ksh
              #    $HCISITEDIR/scripts/site_startup.ksh
              #
              # scripts for every clvoerleaf site for the current $HCIROOT
              #
              #——-
              # Notes:
              #——-
              #
              # before calling this script be sure the $HCIROOT is set appropriately
              #
              # after this script is completed you will need to run the scripts that got created
              # by invoking them manually one at a time or by running all of the by doing one of the following:
              #
              #    mda_cloverleaf_IPL.ksh shutdown
              #    mda_cloverleaf_IPL.ksh start
              #
              #
              #———
              # History:
              #———
              #
              # 2002.11.07 Russ Ross
              #          – wrote initial version.
              #
              # 2003.02.28 Russ Ross
              #          – modified the stop_directory and start_directory to include the cloverleaf version #
              #
              # 2002.03.14 Russ Ross
              #          – removed the stop_directory and start_directory variables
              #            becuase redisgned to use the $HCISITEDIR/scripts
              #
              # 2003.03.21 Russ Ross
              #          – added hci_root variable because setroot -clear gets rid of $HCIROOT
              #
              # 2006.03.06 Russ Ross
              #          – backgrounded mk_stop_start_scripts_for_current_site.tcl to speed
              #            up how long it takes to create all the stop/start scripts for all sites
              #            (used to be on mdahub1 and mdahub4 we had to do this one site at a time
              #            because those system were not powerful engough to do all the sites at once)
              #          – commented out the chmod and chown steps because they will not work
              #            as a result of the backgournding; so these steps have to be done by the
              #            mk_stop_start_scripts_for_current_site.tcl script
              #          – added wait command at the end to make sure all backgrounded process have finished
              #
              # End Module Header ============================================================

              saveDir=`pwd`

              hci_root=$HCIROOT

              for site in `list_sites.ksh`; do
                setroot -clear
                setroot $hci_root $site
                echo ” ”
                echo “——————————-”
                echo “creating stop/start scripts for $HCIROOT/$site”
                echo “——————————-”
                echo ” ”
                if [[ ! -d $HCISITEDIR/scripts ]]; then
                   mkdir $HCISITEDIR/scripts
                fi
                mk_stop_start_scripts_for_current_site.tcl &
              done

              cd $saveDir

              #————————————————————-
              # make sure all the processes this script called have finished
              #————————————————————-

              wait

              I also don’t run setsite from the command prompt but created a function that for Cloverleaf 6.0 I called set60 that passes the site name to the .profile login process and sources the .profile similar to what another poster mentioned above.

              So from the command propmt for example to change sites I type something like

              Code:

              set60 test_russ ; # where test_russ is the site I want to change to

              Here is my set60 function that I use when I want to change sites from one of my interactive xterm command prompts under AIX:

              Code:

              function set60
              {
                 export ROOT=”/cloverleaf/cis6.0/integrator”
                 export SITE=$1
                 currentDir=`pwd`
                 cd $HOME
                 . ~/.profile
                 cd $currentDir
              }

              If you drive yourself crazy looking for setroot it is also a function and was a learning experience discovering this and the motivator for me to utilize creating a function for my set60.

              To see all the defined functions type

              functions

              at the AIX command prompt and you will also see the setroot function defined as follows in Cloverleaf 6.0:

              Code:

              function setroot
              {
                 eval `${CL_INSTALL_DIR}/integrator/sbin/hcisetenv -root ksh $*`
              }

              Russ Ross
              RussRoss318@gmail.com

            • #79987

              Russ is correct. You should do a setroot first. The setroot sets up the Cloverleaf environment for the script. The setsite command sets up the site-specific variables for the script.

              Example Cron Entry: setroot; setsite ;

              -- Max Drown (Infor)

            • #79988
              Kevin Crist
              Participant

                Thanks guys. I will play around with this and see what i can do. What would be different that this is now an issue? Going from Unix to Linux or the big jump from 5.4.1 to 6.0.1?

            Viewing 4 reply threads
            • The forum ‘Cloverleaf’ is closed to new topics and replies.