I hope the replies above are helpful. This is not a situation that I've had to face, but looking at your code, and thinking about the situation in general, I wanted to raise some points: There are other issues that I'd expect to arise, but again, I'm not that familiar with the issues... things like zombie processes (parents going away and leaving unreaped children behind).

On the whole, I'm thinking there must be a better way to actually run this process, other than launching it directly from a cgi script -- e.g. as suggested in a previous reply, you could have a cron process running every few minutes or so, to check whether a request has come in to run fsscan and if so, go ahead and run it (and don't accept any more requests until that run is finished). Then all the cgi script has to do is write some little file somewhere to indicate that such a request has been made.


In reply to Re: Run perl script from web page by graff
in thread Run perl script from web page by smist

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.