| 327 | |
| 328 | === 6/29/2010 === |
| 329 | After 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 | |
| 334 | Note 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 | |
| 336 | The 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 | |
| 338 | I'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 | |