[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

20040624: Perl redirect problems (cont.)



>From: David Ovens <address@hidden>
>Organization: University of Washington
>Keywords: 200406241954.i5OJsCWb010248 LDM PIPE Perl

David,

>I don't have time right now to give a detailed response and am heading
>off camping tomorrow.  But, I can address the main issues you raise.

No worries.

>First, the 'ps' command is definitely /bin/ps always.  I've seen that
>in my detailed diagnostic outputs.

OK, this was a shot in the dark taken because of the knowledge that
you use GEMPAK, and GEMPAK has a PostScript (tm) driver that has the
unfortunate name of 'ps'.

>And, even with the correct
>'/bin/ps' the index method with backticks invocation that filled
>$index and $index2 shows that from time to time the same command
>issued twice a row in the zlib2gif.pl script produced different
>results.  This is the main puzzle. 

This really does seem like it would have to be a problem intimately
related to Perl.

>As to how I run the command, Harry Edmon and I modified ldmadmin to
>'exec' a shell and then we ran the command with STDIN from one of
>these zlib-compressed GINI files.  The command works every time,
>flawlessly, run as user ldm.  We've tried as best can to mimic what
>the LDM does, but, something must still be different....

OK, this eliminates a number of possibilities.  We had no way of
knowing that a test like this had been done.

I am still interested in seeing if the environment in which the Perl
script runs is different in the case of being run in a shell exec'd by
ldmadmin and the same script run through a pqact action.  A quick check
on this would be to have the Perl script write out the environment it
is running in (i.e., write the output of 'env' to a log file) and then
compare the two.

>Yes.  Perl could be faulty, but, again, the only manifestation of this
>fault is when an LDM pqact action invokes that PERL script.  I cannot
>reproduce the fault any other way.

This is why I am very curious about the environment in which the
script is running in each case.

There are a couple of ideas that you could perhaps use to work around
what you are seeing:

- have pqact FILE the product and then run your Perl script on the
  then existing file.  Actions in pqact.conf are processed serially,
  so the invocation of the Perl script must come after the FILE
  action.

- have pqact invoke a shell and have your Perl script run in that
  new shell.  This should mimic the test where a shell is exec'd
  from ldmadmin.

Again, we are operating under the assumption that there is nothing
wrong with pqact.  The main reasons for this assumption is that yours
is the first email to mention a problem like this, and we use the
notion of STDIN being cat'd to a file in Bourne shell scripts in
several instances on many machines (not OSF/1, however), one of which
is the filing of all of the NOAAPORT GINI imagery in the NIMAGE feed.

>Second, as to the OSF1/Solaris differences, I modify the pqact.conf 
>on the OSF1 box to this:
>
>FNEXRAD ^rad/NEXRCOMP/(...)/(...)_(........)_(....)
>        FILE
>        /home/data/gempak/nport.compare/RADAR/\1/\2/\2_\3_\4
>FNEXRAD ^rad/NEXRCOMP/(...)/(...)_(........)_(....)
>        PIPE    -close
>        local/gini/bin/png2gif.pl
>        /home/data/gempak/nport/RADAR/\1/\2/\2_\3_\4
>
>This would eliminate possible PERL problems on the OSF1 side.  Then I
>can test the rest of what you suggest.

OK.  My comment above would use this pair of actions if png2gif.pl
was modified to read the file /home/data/gempak/nport/RADAR/\1/\2/\2_\3_\4
produced by the previous action instead of trying to write that file
to disk and then process it.

>Thanks for your ideas,

No worries.

Cheers,

Tom
--
NOTE: All email exchanges with Unidata User Support are recorded in the
Unidata inquiry tracking system and then made publically available
through the web.  If you do not want to have your interactions made
available in this way, you must let us know in each email you send to us.


NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.