I'm not sure whether this is relevant but I had a problem recently when adding some housekeeping code to a script. The script continuously monitored something, writing stuff to a log file. I decided to fork a child process to do housekeeping on old logs and I set $SIG{ CHLD } = q{IGNORE} in the parent before forking as I did not want the parent to interrupt its monitoring while waiting for the child to finish.

Inside the child I was using system to invoke compression on selected log files and deleting others, logging what it was doing to a separate file. I could see from the log that system was successfully invoking bzip2 and the file was being replaced on disk by a compressed version but, strangely, the script was detecting a non-zero exit status and was logging a failure. Further investigation showed that $? contained -1 but that didn't seem to fit with the fact that the child (bzip2) did successfully launch. It turned out that the problem was caused by the $SIG{ CHLD } = q{IGNORE} which caused system to return a -1 exit code. $! was being set and, IIRC, the error was "No child process" or something like but I can't be sure of that. I think the -1 exit code was being returned because, since children were ignored, exit codes were of no use. The solution in my script was to do local $SIG{ CHLD } = q{DEFAULT} in each scope where I was going to do a system call.

None of this explains why you should suddenly get strange behaviour on just one server or why only qx{ ... } is affected. I should explain that I tried substituting qx{ ... } for system( ... ) without success before I got to the root cause of my problem. Although it doesn't seem that your problem is closely connected to the one I had, I thought it had enough parallels to make it worth mentioning here in case it gave you any clues. The platform was RHEL 5.4 with perl 5.8.8 interpreter.

I hope this is helpful.

Cheers,

JohnGG


In reply to Re: qx(....) suddenly failing by johngg
in thread qx(....) suddenly failing by rovf

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.