Script to write to {process}.log and {process}.log.old

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Script to write to {process}.log and {process}.log.old

  • Creator
    Topic
  • #48941
    Jerry Mai
    Participant

      I am interested in finding the script inside the Cloverleaf engine to write data into processname.log and processname.log.old each time I cycle a process by using hcienginestop -p processname and hcienginerun -p processname.  I looked into hcienginestop and hcienginerun scripts but couldn’t find it.  I would appreciate anyone tells me where it locates.  -Thanks.

      Jerry Mai

      Mayo Clinic

    Viewing 5 reply threads
    • Author
      Replies
      • #60189
        garry r fisher
        Participant

          Hi Jerry,

          I’m not definite about this but I would have thought this would be part of hciengine.exe and not any script. Its how I would have done it if I’d written Cloverleaf:-)

          Regards

          Garry

        • #60190
          Robert Kersemakers
          Participant

            Hi Jerry,

            We are on HP-UX and CL 5.2; the hcienginerun/stop scripts are in /hci/qdx5.2/integrator/bin.

            Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

          • #60191
            Jerry Mai
            Participant

              Thanks Garry – you are right it is embedded code.

              Jerry Mai

            • #60192
              Jerry Mai
              Participant

                Robert,

                Thanks for showing me the directory.

                Jerry Mai

              • #60193
                Jerry Mai
                Participant

                  Now I understand this is embedded code but does anyone know where exactly this code is called from?  -Thanks.

                  Jerry Mai

                  Mayo Clinic

                • #60194
                  Nathan Martin
                  Participant

                    It might help to know “why” you are asking, but I can guess.

                    If you just want to force logs to cycle.  This will rename the existing logs with ‘.old’ for the adt process:

                    Code:

                    hcicmd -p adt -c ‘. output_cycle’

                    We have a script that runs every night which first adds a date stamp to *.err files then cycles the logs.  Basically, something like this for each process:

                    Code:

                    DATESTAMP=`date +%Y%m%d`
                    PROC=adt
                    ERRFILE=$HCISITEDIR/exec/processes/$PROC/$PROC.err
                    mv $ERRFILE $ERRFILE.$DATESTAMP
                    hcicmd -p $PROC -c ‘. output_cycle’


                    (Overwriting yesterday’s *.log.old is good enough for us.  A cron job deletes *.err.YYYYMMDD files older than a certain age so they don’t pile up.)

                    If you are worried about losing messages in *.old files (which get created accidentally or automatically) you could try modifying hcienginerun to safely move or rename any existng .log and .err files before hciengine is called.  Or you could make a script to rescue .log.old and .err.old files on a periodic basis.  (I’ve thought about it, but never tried it.)

                    By the way, hciengine must be what does the re-naming (and not some script) based on the incriminating printf-style formats found in the executable and the fact that it’s the only place I could find any “.old” references.

                    Code:

                    $ strings `which hciengine` | grep old

                    %s.log.old
                    %s.err.old

                    Automatic cycling of output log files: eoLogFileCycleThreshold:%d kB logFileSize:%d kB errFileSize:%d kB


                    (Hmmm, eoLogFileCycleThreshold seems suspicious too… but I can’t recall anything about it right now.)

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