Batch file for starting processes

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Batch file for starting processes

  • Creator
    Topic
  • #49807
    Mark McDaid
    Participant

      Hello all,

      I don’t know if anyone can shed some light on this for me, but so far I can’t figure this out.  We have a batch file that we run after a reboot of Cloverleaf that contains hcienginerun commands for each process that needs to be started.  The batch file runs fine and I get feedback at the command line showing that each process has been initiated, but not all of them always start.  I’ve tried it in test also, and sometimes they all start, and sometimes they don’t all start.  The ones that don’t start, I can start through the GUI or the command line manually with no problem, but I can’t figure out why I get unpredictable results when running the batch file.  We’re on Windows 2000, QDX5.2.  Anyone seen this or have any ideas?

    Viewing 5 reply threads
    • Author
      Replies
      • #63670
        Rob Abbott
        Keymaster

          You need to wait for the Cloverleaf service to completely start before issuing any hcienginerun commands.  If you look in the startup_log for the failed processes you will probably see “unable to contact hciservice”.

          Put a sleep in your startup script of 30 seconds or so and it should work fine.

          Rob Abbott
          Cloverleaf Emeritus

        • #63671
          Mark McDaid
          Participant

            Rob,

            Thanks for the tip.  That probably explains the behavior when rebooting our production box, but the testing I’ve been doing on our test box has not involved a server reboot or stopping the hciservice.  I’ve just been using a test batch file to stop and start processes.  Should I put a sleep between each hcienginerun command?  It’s never the first one in the batch file that doesn’t start, it’s always the second process.

          • #63672
            Rob Abbott
            Keymaster

              That’s interesting.  Does the startup_log have any useful information?  A lot of users tend to miss this log when diagnosing problems like this.

              You might try a sleep between hciengineruns and see if that helps.  I haven’t had to put a sleep anywhere but at the top of the script.

              Rob Abbott
              Cloverleaf Emeritus

            • #63673
              Michael Hertel
              Participant

                When you say the threads aren’t running, do you know they aren’t running or does the NetMonitor just show them dead?

                Sometimes refreshing the NetMonitor (control-r) will show that the threads actually are running. Try the refresh and see if that helps.

                Another thing you might try is to start the processes and then start the threads.

              • #63674
                Mark McDaid
                Participant

                  Thanks for all the quick responses.  I’ve had to leave the office for the rest of today and I’ll be out tomorrow, then gone all next week, taking the Level 2 class in Dallas.  I’ll try out these suggestions and do some testing when I get back, plus I’ll probably ask about it in my Level 2 class.  I’ll post any new info when I return.

                • #63675
                  Richard Hart
                  Participant

                    Mark.

                    We are on Unix and below is a part of our ‘start/stop all’ script.  The command siteList.sh returns all ‘actives’ sites and then executes a start or stop script as a background process.  The start scripts performs a ‘crash recovery’ (just in case) and starts the site, checking the log file for anu issues.

                       #

                       # loop through all the sites owned by the user

                       #

                    for mySiteStr in `siteList.sh`

                    do

                           #

                           # the site variable is in the format root:site

                           # we use IFS to split this up, but we DO NOT want to

                           # continue this for other strings!

                           #

                       OLDIFS=$IFS; IFS=:

                       set -A myInfoArr $mySiteStr

                       IFS=$OLDIFS

                       myRoot=${myInfoArr[0]}

                       mySite=${myInfoArr[1]}

                       print -u1 “$scriptName: Execute [$CMD $myRoot $mySite &]”

                       $CMD $myRoot $mySite &

                    done

                    print -u1 “$scriptName: Waiting for child processes”

                    wait

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