0000232: There are emtpy logfiles for ReadDZB/CtrlDZB on wop28.

  

Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000232 [TMS] minor always 07-02-10 21:11 14-06-10 07:54
Reporter Arno Schoenmakers View Status public  
Assigned To Arno Schoenmakers
Priority low Resolution open  
Status closed  
Summary 0000232: There are emtpy logfiles for ReadDZB/CtrlDZB on wop28.
Description In /tms/log on wop28:
-rw-rw-rw- 1 tmsmgr tmsdev 0 Feb 6 17:34 ReadDZB.20100206T173438
-rw-rw-rw- 1 tmsmgr tmsdev 0 Feb 6 19:02 CtrlDZB.20100206T190226
-rw-rw-rw- 1 tmsmgr tmsdev 0 Feb 6 19:04 obsco.20100206T190457
-rw-rw-rw- 1 tmsmgr tmsdev 0 Feb 6 19:08 CtrlDZB.20100206T190858
-rw-rw-rw- 1 tmsmgr tmsdev 0 Feb 6 19:09 ReadDZB.20100206T190902

These shouldn't be there at all... Where do these come from? They screw up the ControllerLog.



Additional Information
Attached Files

- Relationships

- Notes
(0000245)
Arno Schoenmakers
07-02-10 21:12

How do Read and CtrlDZB get their logfile?

1) OcsLaunch does:

         TMSString full=aResource->getName()+"."+TMSC::asName(RWTime::now());
        TMSString link=log+"/"+aResource->getName()+".log";
        TMSShellCommand aLinkCmd("rm -f "+link+"; ln -s "+full+" "+link);
         aLinkCmd.setHost(aHost);
        aLinkCmd.runNoWait();
 This creates the link CtrlDZB.log -> CtrlDZB.<time>.log on wop29

        aCmd.setOutput(log+"/"+full);
        aCmd.setNoInput();
 This resets output to CtrlDZB.<time>.log

2) OcsLaunch starts the application remotely with option -Z
In tmsmain.cc this triggers:

  TMSString afilename(getenv("tms_log"));
  afilename += "/" + getName() + ".log";
  open("/dev/null", O_RDONLY); // reroute stdin
  open(afilename,O_RDWR|O_CREAT|O_APPEND, 0666); // reroute stdout
  open(afilename,O_RDWR|O_CREAT|O_APPEND, 0666); // reroute stderr
 i.e., the Controller redirects all to $tms_log/CtrlDZB.log

3) in shellcommand.cc staat:
     if (!itsOutputFile.isNull()) {
       // Outputfile is local file, always!
       if (itsHost.contains("root")) {
          aCmd+=")' >"+itsOutputFile+" 2>&1";
        } else {
          aCmd+=")' >& "+itsOutputFile;
        }
  -> Die lijkt dus de lokale file op wop28 aan te maken. Maar waar komt de log file op wop29 dan vandaan...?

 
(0000276)
Arno Schoenmakers
25-03-10 11:25

When an outputfilename has been set, shellcommand will redirect output/errors of startup command to a local (wop28-based) file with that name. That implies that there will be two logfiles (one on wop28, one remotely) with the same name, just as we saw.

So I changed OcsLaunch in a way that when an application runs remotely, the local logfile (on wop28) has a different name (original name + ".run"). This still allows to catch possible problems in the startup commands.

Has been activated on Mar. 24 2010, 11:20 UT. Tested with ReadDZB startup/stop sequences.
 

- Issue History
Date Modified Username Field Change
07-02-10 21:11 Arno Schoenmakers New Issue
07-02-10 21:12 Arno Schoenmakers Note Added: 0000245
07-02-10 21:12 Arno Schoenmakers Assigned To  => Arno Schoenmakers
07-02-10 21:12 Arno Schoenmakers Status new => assigned
25-03-10 11:25 Arno Schoenmakers Note Added: 0000276
25-03-10 11:25 Arno Schoenmakers Status assigned => resolved
14-06-10 07:54 Arno Schoenmakers Status resolved => closed