Easy way to stop the monitor daemons over multiple sites

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Easy way to stop the monitor daemons over multiple sites

  • Creator
    Topic
  • #54751
    Mike Campbell
    Participant

      Greetings CL gurus.  

      I have updated our production site to now have multiple sites to enhance throughput.  That is working as expected.  

      Now I need to apply the 6.0.2 patch to the existing 6.0 level in production.

      Is there anyway to easily stop all the monitor daemons or does that need to be done site by site?  

      Thanks.

      Mike C.

      CL version 6.0 on AIX.

    Viewing 1 reply thread
    • Author
      Replies
      • #82845
        Rob Lindsey
        Participant

          I use two different shell scripts.  If I want to stop every site call the stop_CL_everything   script

          It has this code in it:

          Code:

          for site in `ls -1d /hci/cis5.8/integrator/*/exec | grep exec | grep -v siteProto | cut -d”/” -f5`
          do
             echo “Stopping site $site…”
             /hci/cis5.8/integrator/usercmds/stop_site $site &
             sleep 5
          done

          echo “Waiting…”
          wait

          echo ‘Cloverleaf Jobs are done’

          The stop_site shell script looks like this:

          Code:

          #!/usr/bin/ksh
          user=$(whoami)

          if [ $user != “hci” ]
           then
             echo “You must be user hci to run this script.”
             exit
          fi

          typeset -i recnum
          typeset -i errnum
          typeset -i err
          err=0
          if [[ -z $1 ]]
           then
                 echo “”
                 echo ”   ** Need to supply a site.  Can not run without a site”
                 echo “”
                 exit
          fi

          site=$1
          autoload setroot
          setroot /hci/cis5.8/integrator $site

          for proc in `hciprocstatus|sed 1,2d|cut -d” ” -f1`
           do
                 echo “Shutting Down Process – $proc”
                 hcienginestop -p $proc &
           done

          echo “”
          echo “nnWaiting for stopping processes…”
          wait

          echo “Stopping Deamons”
          hcisitectl -Kf
          echo “”
          sleep 10
          echo “checking to make sure that the Monitor Deamon is stopped…”
          echo “Checking Monitor…”
             if [[ -a /hci/cis5.8/integrator/$site/exec/hcimonitord/pid ]]
               then
                         PID=$(cat /hci/cis5.8/integrator/$site/exec/hcimonitord/pid)
                         echo “Checking for process id of – $PID”
                         ps -ef | grep -q $PID
                         if [[ $? -eq 1 ]]
                           then
                                 echo “Site: $site is not really running even though it has a monitor daemon pid file”
                         else
                                 echo “Killing the running Monitor Deamons”
                                 kill -9 $PID
                         fi
             else
                 echo “Monitor is not running.”
             fi

          sleep 10
          echo “Done.”
          exit

          Let me know if you need anything explained.

          Rob

        • #82846
          Mike Campbell
          Participant

            Thanks Rob.  Appreciate the examples.

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