Bouncing threads using the HCI crontab

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Bouncing threads using the HCI crontab

  • Creator
    Topic
  • #53243
    Mike Keys
    Participant

      Having some real trouble trying to get a simple script to run. Just need a couple of crontab entries to stop/start a couple of threads.

      The contents of the script is:

      hcicmd -p -c ` pstop`

      I call this from the hci crontab as so:

      11 10 * * * setroot;setsite prod;/home/hci/_stop.sh

      When it runs, the crontab reports that it can’t find setroot or setsite.

      What am I missing?

    Viewing 6 reply threads
    • Author
      Replies
      • #77026
        James Cobane
        Participant

          Mike,

          Try adding the actual root as part of the cron entry. Try this:

          11 10 * * * setroot /qvdx/cis5.8.integrator;setsite prod;hcicmd -p

        • #77027
          Steve Carter
          Participant

            Mike,

            Another option would to be source hci’s .profile.  This will keep you from having to change any hardcoded values in cron if you upgrade since the information will come from the profile.

            11 10 10 * * * (. /home/hci/.profile ; setsite prod ; hcicmd -p -c ` pstop`; hcicmd -p   -c ` pstart`

            Steve

          • #77028
            Mike Keys
            Participant

              James Cobane wrote:

              Mike,

              Try adding the actual root as part of the cron entry. Try this:

              11 10 * * * setroot /qvdx/cis5.8.integrator;setsite prod;hcicmd -p

            • #77029
              Mike Keys
              Participant

                Steve Carter wrote:

                Mike,

                Another option would to be source hci’s .profile.

              • #77030
                Mike Keys
                Participant

                  Question:

                  Should the hci crontab file be owned by hci:staff?

                  When the cronjob runs, I notice that the owner:group reverts back to root:staff. I wonder if this is an issue.

                • #77031
                  Robert Kersemakers
                  Participant

                    Another thing to try: first switch to user ‘hci’ so all variables are set correctly and then execute the scripts/commands.

                    Code:

                    11 10 10 * * * su hci -c

                    Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

                  • #77032
                    Mike Keys
                    Participant

                      Robert Kersemakers wrote:

                      Another thing to try: first switch to user ‘hci’ so all variables are set correctly and then execute the scripts/commands.

                      Code:

                      11 10 10 * * * su hci -c

                      I did try that and same result. I was able to get it to work but I had to include everything in my script. Here is what I had to do:

                      #!/bin/ksh

                      # bounce_isys.sh

                      # This executable will set correct environment variables

                      # and run the commands to bounce the isys_a_ob and isys_r_ib

                      # threads.

                      # ** Edit these env variables to reflect the actual root & site **

                       export SITE=”prod”

                       export ROOT=”/quovadx/qdx5.6/integrator”

                      # Setup userid environment

                       export FPATH=$FPATH:/quovadx/qdx5.6/integrator/kshlib

                       export PATH=$PATH:$ROOT/bin

                       export QUOVADX_INSTALL_DIR=”/quovadx/qdx5.6″

                       export CL_INSTALL_DIR=”/quovadx/qdx5.6″

                       eval ‘/quovadx/qdx5.6/integrator/sbin/hcisetenv -root ksh $ROOT $SITE’

                      # Set the root directory and site

                       setroot $ROOT ;

                       setsite $SITE ;

                      # Run the commands to bounce the threads

                      hcicmd -p ISYS -c ‘isys_a_ob pstop’;hcicmd -p ISYS -c ‘isys_r_ib pstop’

                      hcicmd -p ISYS -c ‘isys_a_ob pstart’;hcicmd -p ISYS -c ‘isys_r_ib pstart’

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