Run hcicmd from a tcl script

Clovertech Forums Cloverleaf Run hcicmd from a tcl script

  • Creator
    Topic
  • #121044
    JD
    Participant

      Hello – I have a tcl script that gathers inbound and outbound thread lists by loading the NetConfig, extracting key pair information.

      I would like to run the hcicmd command on the lists to stop the threads; only way that I’ve come across to run the command is to use “exec”; this works great for stopping/starting the threads from the tcl script.

      Does stopping/starting the threads with “exec” in the tcl script put a load/stress on the linux box to be concerned about in general?   Does it or will it leave files, locks, linux processes open?  Hope I’m making some sense.   If there’s perhaps an exising script to stop/start threads from tcl script that I can use for reference that would be great.  Thanks in advance. JD

    Viewing 2 reply threads
    • Author
      Replies
      • #121045
        Charlie Bursell
        Participant

          The only problem I see here is that thread may or may not stop.  Depending how busy the process is the command may time out.  No clean up needed for stopping a thread as all of the resources are assigned to the process.  There is a perl command in $HCIROOT/bin named hcienginestop.pl which can be called but it will stop all.  You could take a look and see how it does cleanup.

        • #121072
          JD
          Participant

            Initially I tested explicitly with one process, one thread, one site, and it all worked smoothly; now it looks like a time out (as you mentioned) may be occurring and the threads do not stop.  Also, seems the hcicmd command to stop the thread works when script is run when setsite is set to the site where the thread lives.  Can the perl command be run from a tcl script via “exec”?

          • #121076
            Charlie Bursell
            Participant

              hcicmd will always run in the current site.

              You can exec any executable from Tcl.  How it behaves depends on how it is written.  Where the output goes where it expects input from dependencies, etc.

               

          Viewing 2 reply threads
          • You must be logged in to reply to this topic.