Changes between Version 31 and Version 32 of Internal/InventoryV3


Ignore:
Timestamp:
Jun 29, 2010, 7:24:04 PM (14 years ago)
Author:
ssugrim
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Internal/InventoryV3

    v31 v32  
    325325
    326326Since I now checkin last and call it externally. I should include number of changed lines in my checkin. Would be helpful for diagnostics.
     327
     328=== 6/29/2010 ===
     329After some thought, I realized that Writer should call logcopy as it's last action. This ensures that log copy copies a complete file. It avoids a timing problem where the Inventory script would have to guess a reasonable time for writer to complete. Logcopy is ensure a properly closed file as writer controls when logcopy is called. I could have put this in a at_Exit block, bit I just left it in the MAIN ensure block. I used the system call:
     330{{{
     331 system("/usr/bin/ruby /root/logcopy.rb")
     332}}}
     333
     334Note the explicit paths. The OMF exec subshells don't understand relative paths. I could have used exec, but it replaces the current process with the one to be execed. While this could have worked it would have prematurely terminated writer with out closing out all the objects.  That probably should matter, but it's not neat. While checking on the exection I noted that at the point where writer invokes logcopy,
     335
     336The 3 mains competeing stratgies are system, exec, and %x[]. Where the last one is very similar to back ticks `command `. I guess there is also psopen and ps3open. System is good enough for these purposes since I only care about it execution, not out put.
     337
     338I've created a new inventory image and inventory script to reflect this change: james_inv_2.ndz and inventory2-2.rb are a testing pair. They'll replace the last known good pair: james_inv.ndz and inventory2-1.rb
     339
    327340