Startup Script

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Startup Script

  • Creator
    Topic
  • #51531
    Garrett Fletcher
    Participant

      Hello,

      I am making a startup script for Cloverleaf. I am trying to make it 100% automated so a user does not have to monitor the process. Here is my script:

      Code:

      REM set root and site
      call setroot C:quovadxqdx5.3integrator
      call setsite testsite1
      call showroot

      REM start Monitor Daemon
      hcisitectl -s m

      REM starts process
      hcienginerun -p centricity

      REM start threads
      hcicmd -p centricity -c “logicianDTS_lab_out pstart”
      hcicmd -p centricity -c “logican_lab_out pstart”
      hcicmd -p centricity -c “bay_lab_out pstart”

      REM move alert files
      move /Y

      C:quovadxqdx5.3integratortestsite1TEMPdefault.alrt

      C:quovadxqdx5.3integratortestsite1Alerts

      The problem is starting the threads. If The process does not start fast enough the threads do not start with the hcicmd command. Does anyone know how to get around this?

      Alos, I am thinking about setting all my threads to ‘auto-start connection’ so I dont have to script in all the threads. Does anyone see a process with setting all my threads to ‘auto-start connection’?

      Thank you,

      Garrett

    Viewing 15 reply threads
    • Author
      Replies
      • #70655
        Robert Kersemakers
        Participant

          Hi Garret,

          We have all our threads on ‘Auto-start connection’, so when starting the process, all the related threads are started automatically. Never had any problems with that. We just made sure that when starting several processes back-to-back, there would be some time (10 or 20 seconds) between these startups. Because starting all processes at once didn’t work well.

          I see you will start the Monitor Daemon, but you don’t start the Lockmanager, nor the Hostserver. But it all depends on when you want to use this script and therefore what you want it to do.

          Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

        • #70656
          Russ Ross
          Participant

            We have found there are situations where using auto-start gets in the way.

            I don’t need to start any arguments about whose opinion has more merit but we started out with autostart but ended up deciding it was better to not allow any threads in production to be auto-start.

            We also found maintaining static shutdown and startup scripts like you are working on requires they be kept up to date and that doesn’t end up happening when someone doesn’t follow procedure or over looks mainting them.

            Of course with a smaller number of threads the problem may not exist but we have over 1200 threads so it motivated us to find a better more reliable less effort approach.

            We too lived through the process just like you are doing now but felt like we had already learned to not fall back to using auto-start as the path of least resistance.

            I would like to thank my co-worker Jim Kosloskey for influencing us to not lapse back into using auto-start because what we have now seems so much better.

            So now we wanted granualarity of control and something that was dynamic and required no effot for us to maintain and would work if called by a HACMP fail-over event even if it wasn’t a gracefull shutdown but a hard fail-over.

            What I did was to first write a script to take an intellegent snapshot of the current cloverleaf site and dynamically create the stop and start scripts for the current site in $HCISITEDIR/scripts and here is that script called mk_stop_start_scripts_for_current_site.tcl

            #!/usr/bin/ksh
            # this line to escape the next line from the tcl interpreter
            exec hcitcl “$0” “$@”

            # Begin Module Header ==========================================================
            #
            #———
            # Purpose:
            #———
            #
            # dynamically create the following scripts
            #
            #
            [code]#!/usr/bin/ksh
            # this line to escape the next line from the tcl interpreter
            exec hcitcl “$0” “$@”

            # Begin Module Header ==========================================================
            #
            #


            # Purpose:
            #


            #
            # dynamically create the following scripts
            #
            #

            Russ Ross
            RussRoss318@gmail.com

          • #70657
            Garrett Fletcher
            Participant

              Thank you so much. I like the idea of dynamically created scripts. These will take a bit of tweaking to run on our system since we are on Windows, but I will dive into it and let you know if I run into any trouble.

              Also, I have been told by multiple people that the auto-start option is not a good idea. Can you please let me know what issues it caused for you? I just want to get a better understanding of the possible consequences.

              Garrett

            • #70658
              Russ Ross
              Participant

                I didn’t give specific examples because I didn’t want to get in a circular argument but since you asked I will give a quick one of the top of my head.

                Russ Ross
                RussRoss318@gmail.com

              • #70659
                Garrett Fletcher
                Participant

                  Gotchya. Yes, I could see that being a problem here too. Thanks for the insight.

                  Garrett

                • #70660
                  Garrett Fletcher
                  Participant

                    Thank you, Russ for all of the really good information and for posting your scripts.

                    I made some new scripts to work with Windows. Here they are. I have only run them on my test server, but I plan on using them in our live environment on Thursday when we reboot for scheduled maintenance.

                    To run these put them all in the same directory and run the start or stop batch file. The batch files call the TCL files.

                    Here they are. These will run for all the sites that you specify in the BAT file.

                    Please critique these and give me any suggestions you think will make these better.

                  • #70661
                    Garrett Fletcher
                    Participant

                      So I tried this in a live environment. When I ran the Stop script it haulted when some alerts tried to fire in the middle of the script. I will modify the stop scritp to shut off the alerts before doing anything and repost it.

                      Garrett

                    • #70662
                      Russ Ross
                      Participant

                        Yes turning off alerts is one of the steps I do as seen by the entry

                        turn_off_alerts.ksh; sleep 3

                        This is especially important when starting things up that might of been down for a while.

                        For us our alerts aren’t instaneous and take 5 or more minutes to trigger, so we haven’t had any issues with alerts firing during shutdown.

                        Russ Ross
                        RussRoss318@gmail.com

                      • #70663
                        Gina Borden
                        Participant

                          We have a restart script that we have been using for about 5 years, we schedule it in cron to start every night at midnight.  Basically it creates a list of sites, and goes through each site, shuts down the processes, then restarts the process.  

                          My problem is our site shutdowns and startups, whether initiated through the script or manually, are really sluggish.  I have had to increase the timeout a couple of times now.

                          Does anyone have any idea why this would be?  We are on version 5.3, on an AIX platform.  I am hoping for  a new server and cloverleaf upgrade this year, but need some help with this until them.

                          Any help would be greatly appreciated.

                          Gina

                        • #70664
                          Garrett Fletcher
                          Participant

                            I have not found a way to avoid some sleep states in my script.

                            But your post did remind me of another question I had. Does anyone know if there is a way to grab a list of sites from cloverleaf?

                            In the script I created you have to manually put in the sites. And it looks like Russ’s script is designed to be run once for each site to create the start/stop scripts.

                            Thanks,

                            G

                          • #70665
                            Russ Ross
                            Participant

                              Here is the script ( list_sites.ksh ) I use to dynamically list and loop thru all the cloverleaf sites

                              #!/usr/bin/ksh

                              # Begin Module Header ==============================================================================
                              #
                              #——
                              # Name:
                              #——
                              #
                              # list_sites.ksh
                              #
                              #———
                              # Purpose:
                              #———
                              #
                              # List all the sites for the current $HCIROOT
                              #
                              #——–
                              # Inputs:
                              #——–
                              #
                              # none
                              #
                              #——-
                              # Notes:
                              #——-
                              #
                              # This script assumes the proper environment is set when it is called
                              # and all sites are symbolic links at the $HCIROOT level
                              #
                              #———
                              # History:
                              #———
                              #
                              # 2001.02.22 Russ Ross
                              #
                              [code]#!/usr/bin/ksh

                              # Begin Module Header ==============================================================================
                              #
                              #


                              # Name:
                              #


                              #
                              # list_sites.ksh
                              #
                              #


                              # Purpose:
                              #


                              #
                              # List all the sites for the current $HCIROOT
                              #
                              #


                              # Inputs:
                              #


                              #
                              # none
                              #
                              #


                              # Notes:
                              #


                              #
                              # This script assumes the proper environment is set when it is called
                              # and all sites are symbolic links at the $HCIROOT level
                              #
                              #


                              # History:
                              #


                              #
                              # 2001.02.22 Russ Ross
                              #

                              Russ Ross
                              RussRoss318@gmail.com

                            • #70666
                              Chris Williams
                              Participant

                                Another way to grab a list of currently defined sites is from the file $HCIROOT/server/server.ini, in the line beginning “environs=”.

                              • #70667
                                Russ Ross
                                Participant

                                  I actually use list_sites.ksh to set the environs variable in $HCIROOT/server/server.ini to create a sorted listing of sites in our IDE.

                                  Here is the URL

                                  <a href="https://usspvlclovertch2.infor.com/viewtopic.php?t=1424&#8243; class=”bbcode_url”>https://usspvlclovertch2.infor.com/viewtopic.php?t=1424

                                  posting the code for

                                  set_server_ini_environs.ksh

                                  mk_server_ini_environs.ksh

                                  list_sites.ksh

                                  Russ Ross
                                  RussRoss318@gmail.com

                                • #70668
                                  Garrett Fletcher
                                  Participant

                                    Ok the scripts that shut down the sites are working. Here they are.

                                    However, the Start scripts always hang when it gets to the point where it starts the processes and threads. Here is the part of the code where it is hanging.

                                    Code:


                                    foreach processLoop $allProcesses {

                                    exec perl [file join $::HciRoot bin hcienginerun.pl] -p $processLoop
                                    puts “Starting Processes:”
                                    puts “hcienginerun $processLoop: waiting while it starts”
                                    after 15000
                                    puts $processLoop

                                    keylget processList $processLoop threadList
                                    puts “Starting Threads”
                                    foreach thread $threadList {

                                    exec hcicmdnt -p $processLoop -c “$thread pstart”
                                    puts “Thread: $thread started”

                                    }
                                    }
                                     

                                    Is there a better way to start the processes and threads than using hcienginerun, then hcicmdnt?

                                    Thank you,

                                    Garrett

                                  • #70669
                                    Garrett Fletcher
                                    Participant

                                      I just re-read Russ’s script. I am going to try starting the threads in the same line as the process like he does:

                                      “hcienginerun -p tran -s hr_dms_30126,ob_tran; sleep 3”

                                      Thanks Russ!

                                      G

                                    • #70670
                                      Garrett Fletcher
                                      Participant

                                        Ok I got it working Here are the start and stop scripts. Let me know if you have any questions or anything I could be doing better.

                                        Thanks,

                                        Garrett

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